diff --git a/terraform/domains.tf b/terraform/domains.tf index 5b7f59a..b4977ff 100644 --- a/terraform/domains.tf +++ b/terraform/domains.tf @@ -60,7 +60,7 @@ resource "inwx_domain" "twomartens_eu" { // NS records resource "inwx_nameserver_record" "twomartens_de_ns1" { domain = "2martens.de" - name = "" + name = "2martens.de" content = "ns.inwx.de" type = "NS" ttl = 86400 @@ -68,7 +68,7 @@ resource "inwx_nameserver_record" "twomartens_de_ns1" { resource "inwx_nameserver_record" "twomartens_de_ns2" { domain = "2martens.de" - name = "" + name = "2martens.de" content = "ns2.inwx.de" type = "NS" ttl = 86400 @@ -76,7 +76,7 @@ resource "inwx_nameserver_record" "twomartens_de_ns2" { resource "inwx_nameserver_record" "twomartens_de_ns3" { domain = "2martens.de" - name = "" + name = "2martens.de" content = "ns3.inwx.eu" type = "NS" ttl = 86400 @@ -84,7 +84,7 @@ resource "inwx_nameserver_record" "twomartens_de_ns3" { resource "inwx_nameserver_record" "twomartens_eu_ns1" { domain = "2martens.eu" - name = "" + name = "2martens.eu" content = "ns.inwx.de" type = "NS" ttl = 86400 @@ -92,7 +92,7 @@ resource "inwx_nameserver_record" "twomartens_eu_ns1" { resource "inwx_nameserver_record" "twomartens_eu_ns2" { domain = "2martens.eu" - name = "" + name = "2martens.eu" content = "ns2.inwx.de" type = "NS" ttl = 86400 @@ -100,7 +100,7 @@ resource "inwx_nameserver_record" "twomartens_eu_ns2" { resource "inwx_nameserver_record" "twomartens_eu_ns3" { domain = "2martens.eu" - name = "" + name = "2martens.eu" content = "ns3.inwx.eu" type = "NS" ttl = 86400 @@ -110,16 +110,16 @@ resource "inwx_nameserver_record" "twomartens_eu_ns3" { resource "inwx_nameserver_record" "twomartens_de_soa" { domain = "2martens.de" - name = "" - content = "ns.inwx.de hostmaster.inwx.de 2023103000 10800 3600 604800 3600" + name = "2martens.de" + content = "ns.inwx.de hostmaster.inwx.de 2023103008 10800 3600 604800 3600" type = "SOA" ttl = 86400 } resource "inwx_nameserver_record" "twomartens_eu_soa" { domain = "2martens.eu" - name = "" - content = "ns.inwx.de hostmaster.inwx.de 2020080805 10800 3600 604800 3600" + name = "2martens.eu" + content = "ns.inwx.de hostmaster.inwx.de 2023103001 10800 3600 604800 3600" type = "SOA" ttl = 86400 } @@ -127,17 +127,19 @@ resource "inwx_nameserver_record" "twomartens_eu_soa" { // redirect 2martens.eu to 2martens.de resource "inwx_nameserver_record" "twomartens_eu_root_redirect" { domain = "2martens.eu" - name = "" + name = "2martens.eu" content = "https://2martens.de" type = "URL" url_redirect_type = "HEADER301" + prio = 301 ttl = 3600 } resource "inwx_nameserver_record" "twomartens_eu_www_redirect" { domain = "2martens.eu" - name = "www" + name = "www.2martens.eu" content = "https://2martens.de" type = "URL" url_redirect_type = "HEADER301" + prio = 301 ttl = 3600 } \ No newline at end of file diff --git a/terraform/hetzner.tf b/terraform/hetzner.tf index 0d69916..174cbdd 100644 --- a/terraform/hetzner.tf +++ b/terraform/hetzner.tf @@ -7,7 +7,7 @@ module "drone_domain" { } resource "inwx_nameserver_record" "twomartens_de_ci-ownercheck_txt" { domain = "2martens.de" - name = "ownercheck.ci" + name = "ownercheck.ci.2martens.de" content = "e1eb600b" type = "TXT" ttl = 3600 diff --git a/terraform/imports.tf b/terraform/imports.tf index 99bff29..2455a1e 100644 --- a/terraform/imports.tf +++ b/terraform/imports.tf @@ -35,4 +35,192 @@ import { import { to = inwx_nameserver_record.twomartens_eu_soa id = "2martens.eu:378502916" +} +import { + to = module.personal_website_domain.inwx_nameserver_record.a + id = "2martens.de:239663989" +} +import { + to = inwx_nameserver_record.twomartens_de_allris_a + id = "2martens.de:340019353" +} +import { + to = module.api_domain.inwx_nameserver_record.a + id = "2martens.de:1092884501" +} +import { + to = module.argocd_domain.inwx_nameserver_record.a + id = "2martens.de:1212798670" +} +import { + to = inwx_nameserver_record.twomartens_de_autoconfig_a + id = "2martens.de:239663992" +} +import { + to = inwx_nameserver_record.twomartens_de_autodiscover_a + id = "2martens.de:239663993" +} +import { + to = module.drone_domain.inwx_nameserver_record.a + id = "2martens.de:239663999" +} +import { + to = module.nextcloud_domain.inwx_nameserver_record.a + id = "2martens.de:338442650" +} +import { + to = module.gitea_domain.inwx_nameserver_record.a + id = "2martens.de:268916567" +} +import { + to = module.keycloak_domain.inwx_nameserver_record.a + id = "2martens.de:1054579480" +} +import { + to = inwx_nameserver_record.twomartens_de_jim_a + id = "2martens.de:239664005" +} +import { + to = inwx_nameserver_record.twomartens_de_pad_a + id = "2martens.de:394456668" +} +import { + to = module.helm-repo_domain.inwx_nameserver_record.a + id = "2martens.de:1101805861" +} +import { + to = inwx_nameserver_record.twomartens_de_short_a + id = "2martens.de:406563107" +} +import { + to = module.statping_domain.inwx_nameserver_record.a + id = "2martens.de:725319152" +} +import { + to = module.wahlrecht_domain.inwx_nameserver_record.a + id = "2martens.de:1088066410" +} +import { + to = module.personal_website_domain.inwx_nameserver_record.aaaa + id = "2martens.de:239663996" +} +import { + to = inwx_nameserver_record.twomartens_de_allris_aaaa + id = "2martens.de:340019354" +} +import { + to = module.api_domain.inwx_nameserver_record.aaaa + id = "2martens.de:1092884499" +} +import { + to = module.argocd_domain.inwx_nameserver_record.aaaa + id = "2martens.de:1212798943" +} +import { + to = inwx_nameserver_record.twomartens_de_autoconfig_aaaa + id = "2martens.de:239664001" +} +import { + to = inwx_nameserver_record.twomartens_de_autodiscover_aaaa + id = "2martens.de:239664004" +} +import { + to = module.drone_domain.inwx_nameserver_record.aaaa + id = "2martens.de:239664000" +} +import { + to = module.nextcloud_domain.inwx_nameserver_record.aaaa + id = "2martens.de:338442816" +} +import { + to = module.gitea_domain.inwx_nameserver_record.aaaa + id = "2martens.de:268916568" +} +import { + to = module.keycloak_domain.inwx_nameserver_record.aaaa + id = "2martens.de:1054579481" +} +import { + to = inwx_nameserver_record.twomartens_de_jim_aaaa + id = "2martens.de:258187630" +} +import { + to = inwx_nameserver_record.twomartens_de_pad_aaaa + id = "2martens.de:394456669" +} +import { + to = module.helm-repo_domain.inwx_nameserver_record.aaaa + id = "2martens.de:1101808918" +} +import { + to = inwx_nameserver_record.twomartens_de_short_aaaa + id = "2martens.de:406563108" +} +import { + to = module.statping_domain.inwx_nameserver_record.aaaa + id = "2martens.de:725322833" +} +import { + to = module.wahlrecht_domain.inwx_nameserver_record.aaaa + id = "2martens.de:1088066412" +} +import { + to = inwx_nameserver_record.twomartens_de_cdn_cname + id = "2martens.de:258404695" +} +import { + to = inwx_nameserver_record.twomartens_de_aws-validations-cdn_cname + id = "2martens.de:258403560" +} +import { + to = module.nextcloud_domain.inwx_nameserver_record.mx[0] + id = "2martens.de:338450118" +} +import { + to = module.keycloak_domain.inwx_nameserver_record.mx[0] + id = "2martens.de:1055393884" +} +import { + to = module.personal_website_domain.inwx_nameserver_record.mx[0] + id = "2martens.de:239663995" +} +import { + to = inwx_nameserver_record.twomartens_de_ns1 + id = "2martens.de:239663978" +} +import { + to = inwx_nameserver_record.twomartens_de_ns2 + id = "2martens.de:239663979" +} +import { + to = inwx_nameserver_record.twomartens_de_ns3 + id = "2martens.de:239663980" +} +import { + to = inwx_nameserver_record.twomartens_de_soa + id = "2martens.de:239663977" +} +import { + to = inwx_nameserver_record.twomartens_de_google-verification_txt + id = "2martens.de:239663998" +} +import { + to = module.personal_website_domain.inwx_nameserver_record.mx-spf[0] + id = "2martens.de:338469503" +} +import { + to = module.nextcloud_domain.inwx_nameserver_record.mx-spf[0] + id = "2martens.de:338450182" +} +import { + to = module.keycloak_domain.inwx_nameserver_record.mx-spf[0] + id = "2martens.de:1055394105" +} +import { + to = inwx_nameserver_record.twomartens_de_ci-ownercheck_txt + id = "2martens.de:338759677" +} +import { + to = inwx_nameserver_record.twomartens_de_uberspace-domainkey_txt + id = "2martens.de:1055394106" } \ No newline at end of file diff --git a/terraform/modules/domain/main.tf b/terraform/modules/domain/main.tf index 7213d42..7add14a 100644 --- a/terraform/modules/domain/main.tf +++ b/terraform/modules/domain/main.tf @@ -9,21 +9,21 @@ terraform { resource "inwx_nameserver_record" "a" { domain = var.domain - name = var.subdomain + name = var.subdomain != "" ? format("%s.%s", var.subdomain, var.domain) : var.domain content = var.ipv4 type = "A" ttl = 3600 } resource "inwx_nameserver_record" "aaaa" { domain = var.domain - name = var.subdomain + name = var.subdomain != "" ? format("%s.%s", var.subdomain, var.domain) : var.domain content = var.ipv6 type = "AAAA" ttl = 3600 } resource "inwx_nameserver_record" "mx" { domain = var.domain - name = var.subdomain + name = var.subdomain != "" ? format("%s.%s", var.subdomain, var.domain) : var.domain content = var.hostName type = "MX" prio = var.mxPrio @@ -32,7 +32,7 @@ resource "inwx_nameserver_record" "mx" { } resource "inwx_nameserver_record" "mx-spf" { domain = var.domain - name = var.subdomain + name = var.subdomain != "" ? format("%s.%s", var.subdomain, var.domain) : var.domain content = var.mxSpf type = "TXT" ttl = 3600 diff --git a/terraform/nameserver_records.tf b/terraform/nameserver_records.tf index e146e4d..3b49f81 100644 --- a/terraform/nameserver_records.tf +++ b/terraform/nameserver_records.tf @@ -1,7 +1,7 @@ // A records resource "inwx_nameserver_record" "twomartens_de_allris_a" { domain = "2martens.de" - name = "allris" + name = "allris.2martens.de" content = "185.26.156.105" type = "A" ttl = 3600 @@ -9,7 +9,7 @@ resource "inwx_nameserver_record" "twomartens_de_allris_a" { resource "inwx_nameserver_record" "twomartens_de_autoconfig_a" { domain = "2martens.de" - name = "autoconfig" + name = "autoconfig.2martens.de" content = "185.26.156.22" type = "A" ttl = 3600 @@ -17,7 +17,7 @@ resource "inwx_nameserver_record" "twomartens_de_autoconfig_a" { resource "inwx_nameserver_record" "twomartens_de_autodiscover_a" { domain = "2martens.de" - name = "autodiscover" + name = "autodiscover.2martens.de" content = "185.26.156.22" type = "A" ttl = 3600 @@ -25,7 +25,7 @@ resource "inwx_nameserver_record" "twomartens_de_autodiscover_a" { resource "inwx_nameserver_record" "twomartens_de_jim_a" { domain = "2martens.de" - name = "jim" + name = "jim.2martens.de" content = "185.26.156.65" type = "A" ttl = 3600 @@ -33,7 +33,7 @@ resource "inwx_nameserver_record" "twomartens_de_jim_a" { resource "inwx_nameserver_record" "twomartens_de_pad_a" { domain = "2martens.de" - name = "pad" + name = "pad.2martens.de" content = "185.26.156.132" type = "A" ttl = 3600 @@ -41,7 +41,7 @@ resource "inwx_nameserver_record" "twomartens_de_pad_a" { resource "inwx_nameserver_record" "twomartens_de_short_a" { domain = "2martens.de" - name = "short" + name = "short.2martens.de" content = "95.143.172.56" type = "A" ttl = 3600 @@ -51,7 +51,7 @@ resource "inwx_nameserver_record" "twomartens_de_short_a" { resource "inwx_nameserver_record" "twomartens_de_allris_aaaa" { domain = "2martens.de" - name = "allris" + name = "allris.2martens.de" content = "2a00:d0c0:200:0:b9:1a:9c:61" type = "AAAA" ttl = 3600 @@ -59,7 +59,7 @@ resource "inwx_nameserver_record" "twomartens_de_allris_aaaa" { resource "inwx_nameserver_record" "twomartens_de_autoconfig_aaaa" { domain = "2martens.de" - name = "autoconfig" + name = "autoconfig.2martens.de" content = "2a00:d0c0:200:0:b9:1a:9c16:5d" type = "AAAA" ttl = 3600 @@ -67,7 +67,7 @@ resource "inwx_nameserver_record" "twomartens_de_autoconfig_aaaa" { resource "inwx_nameserver_record" "twomartens_de_autodiscover_aaaa" { domain = "2martens.de" - name = "autodiscover" + name = "autodiscover.2martens.de" content = "2a00:d0c0:200:0:b9:1a:9c16:5d" type = "AAAA" ttl = 3600 @@ -75,7 +75,7 @@ resource "inwx_nameserver_record" "twomartens_de_autodiscover_aaaa" { resource "inwx_nameserver_record" "twomartens_de_jim_aaaa" { domain = "2martens.de" - name = "jim" + name = "jim.2martens.de" content = "2a00:d0c0:200:0:b9:1a:9c:40" type = "AAAA" ttl = 3600 @@ -83,7 +83,7 @@ resource "inwx_nameserver_record" "twomartens_de_jim_aaaa" { resource "inwx_nameserver_record" "twomartens_de_pad_aaaa" { domain = "2martens.de" - name = "pad" + name = "pad.2martens.de" content = "2a00:d0c0:200:0:c0bf:e0ff:fec1:af72" type = "AAAA" ttl = 3600 @@ -91,7 +91,7 @@ resource "inwx_nameserver_record" "twomartens_de_pad_aaaa" { resource "inwx_nameserver_record" "twomartens_de_short_aaaa" { domain = "2martens.de" - name = "short" + name = "short.2martens.de" content = "2001:1a50:11:0:3854:d4ff:fe62:e0d8" type = "AAAA" ttl = 3600 @@ -101,7 +101,7 @@ resource "inwx_nameserver_record" "twomartens_de_short_aaaa" { resource "inwx_nameserver_record" "twomartens_de_cdn_cname" { domain = "2martens.de" - name = "cdn" + name = "cdn.2martens.de" content = "d1fvxyvcoii67h.cloudfront.net" type = "CNAME" ttl = 3600 @@ -109,7 +109,7 @@ resource "inwx_nameserver_record" "twomartens_de_cdn_cname" { resource "inwx_nameserver_record" "twomartens_de_aws-validations-cdn_cname" { domain = "2martens.de" - name = "_4741e2d9c8a605950eebfa048029e4ef.cdn" + name = "_4741e2d9c8a605950eebfa048029e4ef.cdn.2martens.de" content = "_cf71e85bb40cc12717f2718e4590ad23.acm-validations.aws" type = "CNAME" ttl = 3600 diff --git a/terraform/uberspace.tf b/terraform/uberspace.tf index 7bfe56c..df23e5f 100644 --- a/terraform/uberspace.tf +++ b/terraform/uberspace.tf @@ -60,7 +60,7 @@ module "personal_website_domain" { } resource "inwx_nameserver_record" "twomartens_de_google-verification_txt" { domain = "2martens.de" - name = "" + name = "2martens.de" content = "google-site-verification=nUFiHQFxBpBMdX96ELH3TcfyIfXf2ZlwMFYtXjVq5lo" type = "TXT" ttl = 3600 @@ -82,7 +82,7 @@ module "nextcloud_domain" { // domain key resource "inwx_nameserver_record" "twomartens_de_uberspace-domainkey_txt" { domain = "2martens.de" - name = "uberspace._domainkey.id" + name = "uberspace._domainkey.id.2martens.de" content = "v=DKIM1;t=s;n=core;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqs3bFL8W77z7VJHCFbsJ3o68Y1uBbVsbIS1y35CMfRv6wp7si7aIG2ZeKqzdh2dTMsvtvSMaYVq1gT/EtRmTbU/BYC21ff8sqcVqn/ll5nNsk5jKWXTYAlTQp4LBQN7icw94ZNGr5/SDYcnv2nsBYFf2GUviObWXGHX4RaBFNj9NVUNWNin/HicvW+LsbfYq37QtlhjmUn9K96VCwKcTV1mx+Ek0osErYefcOVNawqWIlVRQDLkHZhk1StLsOpRqV+qEjhzTk4n4ZiNtLJG1D9CpHl24d5DKsQDyVFdEfqHimFTSNgiitlkuXg+i+NMiRA9G3gNJtvw8uvfN8f+stQIDAQAB" type = "TXT" ttl = 3600