diff --git a/modules/dns/README.md b/modules/dns/README.md index 11499326..588d9e83 100644 --- a/modules/dns/README.md +++ b/modules/dns/README.md @@ -11,7 +11,7 @@ For DNSSEC configuration, refer to the [`dns_managed_zone` documentation](https: ```hcl module "private-dns" { source = "./fabric/modules/dns" - project_id = "myproject" + project_id = var.project_id name = "test-example" zone_config = { domain = "test.example." @@ -24,10 +24,10 @@ module "private-dns" { "A myhost" = { ttl = 600, records = ["10.0.0.120"] } } iam = { - "roles/dns.admin" = ["group:dns-administrators@myorg.com"] + "roles/dns.admin" = ["group:${var.group_email}"] } } -# tftest modules=1 resources=4 inventory=private-zone.yaml +# tftest modules=1 resources=4 inventory=private-zone.yaml e2e ``` ### Forwarding Zone @@ -35,7 +35,7 @@ module "private-dns" { ```hcl module "private-dns" { source = "./fabric/modules/dns" - project_id = "myproject" + project_id = var.project_id name = "test-example" zone_config = { domain = "test.example." @@ -45,7 +45,7 @@ module "private-dns" { } } } -# tftest modules=1 resources=1 inventory=forwarding-zone.yaml +# tftest modules=1 resources=1 inventory=forwarding-zone.yaml e2e ``` ### Peering Zone @@ -53,7 +53,7 @@ module "private-dns" { ```hcl module "private-dns" { source = "./fabric/modules/dns" - project_id = "myproject" + project_id = var.project_id name = "test-example" zone_config = { domain = "." @@ -71,7 +71,7 @@ module "private-dns" { ```hcl module "private-dns" { source = "./fabric/modules/dns" - project_id = "myproject" + project_id = var.project_id name = "test-example" zone_config = { domain = "test.example." @@ -99,7 +99,7 @@ module "private-dns" { } } } -# tftest modules=1 resources=4 inventory=routing-policies.yaml +# tftest modules=1 resources=4 inventory=routing-policies.yaml e2e ``` ### Reverse Lookup Zone @@ -107,7 +107,7 @@ module "private-dns" { ```hcl module "private-dns" { source = "./fabric/modules/dns" - project_id = "myproject" + project_id = var.project_id name = "test-example" zone_config = { domain = "0.0.10.in-addr.arpa." @@ -116,7 +116,7 @@ module "private-dns" { } } } -# tftest modules=1 resources=1 inventory=reverse-zone.yaml +# tftest modules=1 resources=1 inventory=reverse-zone.yaml e2e ``` ### Public Zone @@ -124,20 +124,20 @@ module "private-dns" { ```hcl module "public-dns" { source = "./fabric/modules/dns" - project_id = "myproject" - name = "example" + project_id = var.project_id + name = "test-example" zone_config = { - domain = "example.com." + domain = "test.example." public = {} } recordsets = { "A myhost" = { ttl = 300, records = ["127.0.0.1"] } } iam = { - "roles/dns.admin" = ["group:dns-administrators@myorg.com"] + "roles/dns.admin" = ["group:${var.group_email}"] } } -# tftest modules=1 resources=3 inventory=public-zone.yaml +# tftest modules=1 resources=3 inventory=public-zone.yaml e2e ``` ## Variables diff --git a/tests/modules/dns/examples/forwarding-zone.yaml b/tests/modules/dns/examples/forwarding-zone.yaml index fc1bc2c8..ab8e9da4 100644 --- a/tests/modules/dns/examples/forwarding-zone.yaml +++ b/tests/modules/dns/examples/forwarding-zone.yaml @@ -26,7 +26,7 @@ values: - gke_clusters: [] networks: - network_url: projects/xxx/global/networks/aaa - project: myproject + project: project-id visibility: private counts: diff --git a/tests/modules/dns/examples/peering-zone.yaml b/tests/modules/dns/examples/peering-zone.yaml index f9ab8494..3832df7a 100644 --- a/tests/modules/dns/examples/peering-zone.yaml +++ b/tests/modules/dns/examples/peering-zone.yaml @@ -14,9 +14,14 @@ values: module.private-dns.google_dns_managed_zone.dns_managed_zone[0]: + cloud_logging_config: + - enable_logging: false description: Terraform managed. dns_name: . + dnssec_config: [] + force_destroy: false forwarding_config: [] + labels: null name: test-example peering_config: - target_network: @@ -25,8 +30,13 @@ values: - gke_clusters: [] networks: - network_url: projects/xxx/global/networks/aaa - project: myproject + project: project-id + reverse_lookup: false + service_directory_config: [] + timeouts: null visibility: private counts: google_dns_managed_zone: 1 + modules: 1 + resources: 1 \ No newline at end of file diff --git a/tests/modules/dns/examples/private-zone.yaml b/tests/modules/dns/examples/private-zone.yaml index 30e59c9f..b378cfce 100644 --- a/tests/modules/dns/examples/private-zone.yaml +++ b/tests/modules/dns/examples/private-zone.yaml @@ -24,12 +24,12 @@ values: - gke_clusters: [] networks: - network_url: projects/xxx/global/networks/aaa - project: myproject + project: project-id visibility: private module.private-dns.google_dns_record_set.dns_record_set["A localhost"]: managed_zone: test-example name: localhost.test.example. - project: myproject + project: project-id routing_policy: [] rrdatas: - 127.0.0.1 @@ -38,7 +38,7 @@ values: module.private-dns.google_dns_record_set.dns_record_set["A myhost"]: managed_zone: test-example name: myhost.test.example. - project: myproject + project: project-id routing_policy: [] rrdatas: - 10.0.0.120 diff --git a/tests/modules/dns/examples/public-zone.yaml b/tests/modules/dns/examples/public-zone.yaml index e4766084..8f2cf15e 100644 --- a/tests/modules/dns/examples/public-zone.yaml +++ b/tests/modules/dns/examples/public-zone.yaml @@ -14,14 +14,14 @@ values: module.public-dns.google_dns_managed_zone.dns_managed_zone[0]: - dns_name: example.com. - name: example - project: myproject + dns_name: test.example. + name: test-example + project: project-id visibility: public module.public-dns.google_dns_record_set.dns_record_set["A myhost"]: - managed_zone: example - name: myhost.example.com. - project: myproject + managed_zone: test-example + name: myhost.test.example. + project: project-id routing_policy: [] rrdatas: - 127.0.0.1 diff --git a/tests/modules/dns/examples/reverse-zone.yaml b/tests/modules/dns/examples/reverse-zone.yaml index 8d0b2465..5c864f6b 100644 --- a/tests/modules/dns/examples/reverse-zone.yaml +++ b/tests/modules/dns/examples/reverse-zone.yaml @@ -17,7 +17,7 @@ values: description: Terraform managed. dns_name: 0.0.10.in-addr.arpa. name: test-example - project: myproject + project: project-id reverse_lookup: true visibility: private diff --git a/tests/modules/dns/examples/routing-policies.yaml b/tests/modules/dns/examples/routing-policies.yaml index e5315bb7..03940436 100644 --- a/tests/modules/dns/examples/routing-policies.yaml +++ b/tests/modules/dns/examples/routing-policies.yaml @@ -16,11 +16,11 @@ values: module.private-dns.google_dns_managed_zone.dns_managed_zone[0]: dns_name: test.example. name: test-example - project: myproject + project: project-id module.private-dns.google_dns_record_set.dns_record_set["A geo"]: managed_zone: test-example name: geo.test.example. - project: myproject + project: project-id routing_policy: - enable_geo_fencing: null geo: @@ -44,7 +44,7 @@ values: module.private-dns.google_dns_record_set.dns_record_set["A regular"]: managed_zone: test-example name: regular.test.example. - project: myproject + project: project-id routing_policy: [] rrdatas: - 10.20.0.1 @@ -53,7 +53,7 @@ values: module.private-dns.google_dns_record_set.dns_record_set["A wrr"]: managed_zone: test-example name: wrr.test.example. - project: myproject + project: project-id routing_policy: - enable_geo_fencing: null geo: []