From 655e0369c6c2a05c80b8d9ec53a0038029c0d63c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Niesiob=C4=99dzki?= Date: Sat, 6 Jan 2024 08:12:49 +0000 Subject: [PATCH 1/4] Rename compute-mig-bc.tf to compute-vm-group-bc.tf --- modules/net-lb-app-ext-regional/README.md | 54 +++++++-------- modules/net-lb-app-ext/README.md | 66 +++++++++---------- ...mpute-mig-bc.tf => compute-vm-group-bc.tf} | 4 +- 3 files changed, 62 insertions(+), 62 deletions(-) rename tests/fixtures/{compute-mig-bc.tf => compute-vm-group-bc.tf} (95%) diff --git a/modules/net-lb-app-ext-regional/README.md b/modules/net-lb-app-ext-regional/README.md index 1de3a82a63..b633047b4f 100644 --- a/modules/net-lb-app-ext-regional/README.md +++ b/modules/net-lb-app-ext-regional/README.md @@ -45,13 +45,13 @@ module "glb-0" { backend_service_configs = { default = { backends = [ - { backend = module.compute-mig-b.group.id }, - { backend = module.compute-mig-c.group.id } + { backend = module.compute-vm-group-b.group.id }, + { backend = module.compute-vm-group-c.group.id } ] } } } -# tftest modules=3 resources=9 fixtures=fixtures/compute-mig-bc.tf +# tftest modules=3 resources=9 fixtures=fixtures/compute-vm-group-bc.tf ``` ### Minimal HTTPS examples @@ -89,8 +89,8 @@ module "ralb-0" { backend_service_configs = { default = { backends = [ - { backend = module.compute-mig-b.group.id }, - { backend = module.compute-mig-c.group.id } + { backend = module.compute-vm-group-b.group.id }, + { backend = module.compute-vm-group-c.group.id } ] protocol = "HTTP" } @@ -106,7 +106,7 @@ module "ralb-0" { } } } -# tftest modules=3 resources=12 fixtures=fixtures/compute-mig-bc.tf +# tftest modules=3 resources=12 fixtures=fixtures/compute-vm-group-bc.tf ``` #### HTTPS backends @@ -123,8 +123,8 @@ module "ralb-0" { backend_service_configs = { default = { backends = [ - { backend = module.compute-mig-b.group.id }, - { backend = module.compute-mig-c.group.id } + { backend = module.compute-vm-group-b.group.id }, + { backend = module.compute-vm-group-c.group.id } ] protocol = "HTTPS" } @@ -146,7 +146,7 @@ module "ralb-0" { } } } -# tftest modules=3 resources=12 fixtures=fixtures/ssl-certificate.tf,fixtures/compute-mig-bc.tf +# tftest modules=3 resources=12 fixtures=fixtures/ssl-certificate.tf,fixtures/compute-vm-group-bc.tf ``` #### HTTP to HTTPS redirect @@ -193,7 +193,7 @@ module "ralb-test-0" { backend_service_configs = { default = { backends = [ - { backend = module.compute-mig-b.group.id }, + { backend = module.compute-vm-group-b.group.id }, ] protocol = "HTTP" } @@ -209,7 +209,7 @@ module "ralb-test-0" { } } -# tftest modules=5 resources=16 fixtures=fixtures/ssl-certificate.tf,fixtures/compute-mig-bc.tf +# tftest modules=5 resources=16 fixtures=fixtures/ssl-certificate.tf,fixtures/compute-vm-group-bc.tf ``` ### Health Checks @@ -230,7 +230,7 @@ module "ralb-0" { backend_service_configs = { default = { backends = [{ - backend = module.compute-mig-b.group.id + backend = module.compute-vm-group-b.group.id }] # no need to reference the hc explicitly when using the `default` key # health_checks = ["default"] @@ -242,7 +242,7 @@ module "ralb-0" { } } } -# tftest modules=3 resources=9 fixtures=fixtures/compute-mig-bc.tf +# tftest modules=3 resources=9 fixtures=fixtures/compute-vm-group-bc.tf ``` To leverage existing health checks without having the module create them, simply pass their self links to backend services and set the `health_check_configs` variable to an empty map: @@ -257,14 +257,14 @@ module "ralb-0" { backend_service_configs = { default = { backends = [{ - backend = module.compute-mig-b.group.id + backend = module.compute-vm-group-b.group.id }] health_checks = ["projects/${var.project_id}/global/healthChecks/custom"] } } health_check_configs = {} } -# tftest modules=3 resources=8 fixtures=fixtures/compute-mig-bc.tf +# tftest modules=3 resources=8 fixtures=fixtures/compute-vm-group-bc.tf ``` ### Backend Types and Management @@ -291,13 +291,13 @@ module "ralb-0" { default-b = { zone = "${var.region}-b" instances = [ - module.compute-mig-b.id + module.compute-vm-group-b.id ] named_ports = { http = 80 } } } } -# tftest modules=3 resources=10 fixtures=fixtures/compute-mig-bc.tf +# tftest modules=3 resources=10 fixtures=fixtures/compute-vm-group-bc.tf ``` #### Managed Instance Groups @@ -397,7 +397,7 @@ module "ralb-0" { endpoints = { e-0 = { instance = "my-ig-b" - ip_address = module.compute-mig-b.internal_ip + ip_address = module.compute-vm-group-b.internal_ip port = 80 } } @@ -405,7 +405,7 @@ module "ralb-0" { } } } -# tftest modules=3 resources=11 fixtures=fixtures/compute-mig-bc.tf +# tftest modules=3 resources=11 fixtures=fixtures/compute-vm-group-bc.tf ``` #### Hybrid NEG creation @@ -530,12 +530,12 @@ module "ralb-0" { backend_service_configs = { default = { backends = [{ - backend = module.compute-mig-b.group.id + backend = module.compute-vm-group-b.group.id }] } other = { backends = [{ - backend = module.compute-mig-c.group.id + backend = module.compute-vm-group-c.group.id }] } } @@ -557,7 +557,7 @@ module "ralb-0" { } } -# tftest modules=3 resources=10 fixtures=fixtures/compute-mig-bc.tf +# tftest modules=3 resources=10 fixtures=fixtures/compute-vm-group-bc.tf ``` ### Complex example @@ -599,14 +599,14 @@ module "ralb-0" { group-zone-b = { zone = "${var.region}-b" instances = [ - module.compute-mig-b.id + module.compute-vm-group-b.id ] named_ports = { http = 80 } } group-zone-c = { zone = "${var.region}-c" instances = [ - module.compute-mig-c.id + module.compute-vm-group-c.id ] named_ports = { http = 80 } } @@ -633,7 +633,7 @@ module "ralb-0" { endpoints = { e-0 = { instance = "my-ig-c" - ip_address = module.compute-mig-c.internal_ip + ip_address = module.compute-vm-group-c.internal_ip port = 80 } } @@ -687,7 +687,7 @@ module "ralb-0" { } } } -# tftest modules=3 resources=18 fixtures=fixtures/compute-mig-bc.tf +# tftest modules=3 resources=18 fixtures=fixtures/compute-vm-group-bc.tf ``` @@ -745,6 +745,6 @@ module "ralb-0" { ## Fixtures -- [compute-mig-bc.tf](../../tests/fixtures/compute-mig-bc.tf) +- [compute-mig-bc.tf](../../tests/fixtures/compute-vm-group-bc.tf) - [ssl-certificate.tf](../../tests/fixtures/ssl-certificate.tf) diff --git a/modules/net-lb-app-ext/README.md b/modules/net-lb-app-ext/README.md index bb0d7963c3..5939043cb3 100644 --- a/modules/net-lb-app-ext/README.md +++ b/modules/net-lb-app-ext/README.md @@ -46,13 +46,13 @@ module "glb-0" { backend_service_configs = { default = { backends = [ - { backend = module.compute-mig-b.group.id }, - { backend = module.compute-mig-c.group.id }, + { backend = module.compute-vm-group-b.group.id }, + { backend = module.compute-vm-group-c.group.id }, ] } } } -# tftest modules=3 resources=9 fixtures=fixtures/compute-mig-bc.tf inventory=minimal-http.yaml e2e +# tftest modules=3 resources=9 fixtures=fixtures/compute-vm-group-bc.tf inventory=minimal-http.yaml e2e ``` ### Minimal HTTPS examples @@ -69,8 +69,8 @@ module "glb-0" { backend_service_configs = { default = { backends = [ - { backend = module.compute-mig-b.group.id }, - { backend = module.compute-mig-c.group.id }, + { backend = module.compute-vm-group-b.group.id }, + { backend = module.compute-vm-group-c.group.id }, ] protocol = "HTTP" } @@ -84,7 +84,7 @@ module "glb-0" { } } } -# tftest modules=3 resources=10 fixtures=fixtures/compute-mig-bc.tf inventory=http-backends.yaml e2e +# tftest modules=3 resources=10 fixtures=fixtures/compute-vm-group-bc.tf inventory=http-backends.yaml e2e ``` #### HTTPS backends @@ -99,8 +99,8 @@ module "glb-0" { backend_service_configs = { default = { backends = [ - { backend = module.compute-mig-b.group.id }, - { backend = module.compute-mig-c.group.id }, + { backend = module.compute-vm-group-b.group.id }, + { backend = module.compute-vm-group-c.group.id }, ] protocol = "HTTPS" } @@ -121,7 +121,7 @@ module "glb-0" { } } } -# tftest modules=3 resources=10 fixtures=fixtures/compute-mig-bc.tf inventory=https-backends.yaml e2e +# tftest modules=3 resources=10 fixtures=fixtures/compute-vm-group-bc.tf inventory=https-backends.yaml e2e ``` #### HTTP to HTTPS redirect @@ -165,7 +165,7 @@ module "glb-test-0" { backend_service_configs = { default = { backends = [ - { backend = module.compute-mig-b.group.id }, + { backend = module.compute-vm-group-b.group.id }, ] protocol = "HTTP" } @@ -180,7 +180,7 @@ module "glb-test-0" { } } -# tftest modules=5 resources=14 fixtures=fixtures/compute-mig-bc.tf inventory=http-https-redirect.yaml e2e +# tftest modules=5 resources=14 fixtures=fixtures/compute-vm-group-bc.tf inventory=http-https-redirect.yaml e2e ``` ### Classic vs Non-classic @@ -196,13 +196,13 @@ module "glb-0" { backend_service_configs = { default = { backends = [ - { backend = module.compute-mig-b.group.id }, - { backend = module.compute-mig-c.group.id }, + { backend = module.compute-vm-group-b.group.id }, + { backend = module.compute-vm-group-c.group.id }, ] } } } -# tftest modules=3 resources=9 fixtures=fixtures/compute-mig-bc.tf inventory=classic-vs-non-classic.yaml e2e +# tftest modules=3 resources=9 fixtures=fixtures/compute-vm-group-bc.tf inventory=classic-vs-non-classic.yaml e2e ``` ### Health Checks @@ -221,7 +221,7 @@ module "glb-0" { backend_service_configs = { default = { backends = [{ - backend = module.compute-mig-b.group.id + backend = module.compute-vm-group-b.group.id }] # no need to reference the hc explicitly when using the `default` key # health_checks = ["default"] @@ -233,7 +233,7 @@ module "glb-0" { } } } -# tftest modules=3 resources=9 fixtures=fixtures/compute-mig-bc.tf inventory=health-check-1.yaml e2e +# tftest modules=3 resources=9 fixtures=fixtures/compute-vm-group-bc.tf inventory=health-check-1.yaml e2e ``` To leverage existing health checks without having the module create them, simply pass their self links to backend services and set the `health_check_configs` variable to an empty map: @@ -246,14 +246,14 @@ module "glb-0" { backend_service_configs = { default = { backends = [{ - backend = module.compute-mig-b.group.id + backend = module.compute-vm-group-b.group.id }] health_checks = ["projects/${var.project_id}/global/healthChecks/custom"] } } health_check_configs = {} } -# tftest modules=3 resources=8 fixtures=fixtures/compute-mig-bc.tf inventory=health-check-2.yaml +# tftest modules=3 resources=8 fixtures=fixtures/compute-vm-group-bc.tf inventory=health-check-2.yaml ``` ### Backend Types and Management @@ -278,13 +278,13 @@ module "glb-0" { default-b = { zone = "${var.region}-b" instances = [ - module.compute-mig-b.id + module.compute-vm-group-b.id ] named_ports = { http = 80 } } } } -# tftest modules=3 resources=10 fixtures=fixtures/compute-mig-bc.tf inventory=instance-groups.yaml e2e +# tftest modules=3 resources=10 fixtures=fixtures/compute-vm-group-bc.tf inventory=instance-groups.yaml e2e ``` #### Managed Instance Groups @@ -432,7 +432,7 @@ module "glb-0" { endpoints = { e-0 = { instance = "my-ig-b" - ip_address = module.compute-mig-b.internal_ip + ip_address = module.compute-vm-group-b.internal_ip port = 80 } } @@ -440,7 +440,7 @@ module "glb-0" { } } } -# tftest modules=3 resources=11 fixtures=fixtures/compute-mig-bc.tf inventory=zonal-neg-creation.yaml e2e +# tftest modules=3 resources=11 fixtures=fixtures/compute-vm-group-bc.tf inventory=zonal-neg-creation.yaml e2e ``` #### Hybrid NEG creation @@ -636,12 +636,12 @@ module "glb-0" { backend_service_configs = { default = { backends = [{ - backend = module.compute-mig-b.group.id + backend = module.compute-vm-group-b.group.id }] } other = { backends = [{ - backend = module.compute-mig-c.group.id + backend = module.compute-vm-group-c.group.id }] } } @@ -663,7 +663,7 @@ module "glb-0" { } } -# tftest modules=3 resources=10 fixtures=fixtures/compute-mig-bc.tf inventory=url-map.yaml e2e +# tftest modules=3 resources=10 fixtures=fixtures/compute-vm-group-bc.tf inventory=url-map.yaml e2e ``` ### SSL Certificates @@ -699,8 +699,8 @@ module "glb-0" { backend_service_configs = { default = { backends = [ - { backend = module.compute-mig-b.group.id }, - { backend = module.compute-mig-c.group.id }, + { backend = module.compute-vm-group-b.group.id }, + { backend = module.compute-vm-group-c.group.id }, ] protocol = "HTTP" } @@ -716,7 +716,7 @@ module "glb-0" { } } } -# tftest modules=3 resources=12 fixtures=fixtures/compute-mig-bc.tf inventory=ssl-certificates.yaml e2e +# tftest modules=3 resources=12 fixtures=fixtures/compute-vm-group-bc.tf inventory=ssl-certificates.yaml e2e ``` ### Complex example @@ -761,14 +761,14 @@ module "glb-0" { group-zone-b = { zone = "${var.region}-b" instances = [ - module.compute-mig-b.id + module.compute-vm-group-b.id ] named_ports = { http = 80 } } group-zone-c = { zone = "${var.region}-c" instances = [ - module.compute-mig-c.id + module.compute-vm-group-c.id ] named_ports = { http = 80 } } @@ -795,7 +795,7 @@ module "glb-0" { endpoints = { e-0 = { instance = "my-ig-c" - ip_address = module.compute-mig-c.internal_ip + ip_address = module.compute-vm-group-c.internal_ip port = 80 } } @@ -849,7 +849,7 @@ module "glb-0" { } } } -# tftest modules=3 resources=19 fixtures=fixtures/compute-mig-bc.tf inventory=complex-example.yaml e2e +# tftest modules=3 resources=19 fixtures=fixtures/compute-vm-group-bc.tf inventory=complex-example.yaml e2e ``` @@ -911,5 +911,5 @@ module "glb-0" { ## Fixtures -- [compute-mig-bc.tf](../../tests/fixtures/compute-mig-bc.tf) +- [compute-vm-group-bc.tf](../../tests/fixtures/compute-vm-group-bc.tf) diff --git a/tests/fixtures/compute-mig-bc.tf b/tests/fixtures/compute-vm-group-bc.tf similarity index 95% rename from tests/fixtures/compute-mig-bc.tf rename to tests/fixtures/compute-vm-group-bc.tf index fbf8f3112e..59183f9392 100644 --- a/tests/fixtures/compute-mig-bc.tf +++ b/tests/fixtures/compute-vm-group-bc.tf @@ -13,7 +13,7 @@ # limitations under the License. -module "compute-mig-b" { +module "compute-vm-group-b" { source = "./fabric/modules/compute-vm" project_id = var.project_id zone = "${var.region}-b" @@ -30,7 +30,7 @@ module "compute-mig-b" { group = { named_ports = {} } } -module "compute-mig-c" { +module "compute-vm-group-c" { source = "./fabric/modules/compute-vm" project_id = var.project_id zone = "${var.region}-c" From 8c220498c8ae39a1ba5e4e6c6c84d3e1df1c54d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Niesiob=C4=99dzki?= Date: Sat, 6 Jan 2024 09:00:12 +0000 Subject: [PATCH 2/4] Add proxy networks to e2e harness --- tests/examples_e2e/setup_module/main.tf | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/examples_e2e/setup_module/main.tf b/tests/examples_e2e/setup_module/main.tf index 4d09f80f82..d212f58240 100644 --- a/tests/examples_e2e/setup_module/main.tf +++ b/tests/examples_e2e/setup_module/main.tf @@ -82,6 +82,37 @@ resource "google_compute_subnetwork" "subnetwork" { region = var.region } +resource "google_compute_subnetwork" "proxy_only_global" { + project = google_project.project.project_id + network = google_compute_network.network.name + name = "proxy-global" + region = var.region + ip_cidr_range = "10.0.17.0/24" + purpose = "GLOBAL_MANAGED_PROXY" + role = "ACTIVE" + lifecycle { + # Until https://github.com/hashicorp/terraform-provider-google/issues/16804 is fixed + # ignore permadiff in ipv6_access_type for proxy_only subnets + ignore_changes = [ipv6_access_type] + } +} + +resource "google_compute_subnetwork" "proxy_only_regional" { + project = google_project.project.project_id + network = google_compute_network.network.name + name = "proxy-regional" + region = var.region + ip_cidr_range = "10.0.18.0/24" + purpose = "REGIONAL_MANAGED_PROXY" + role = "ACTIVE" + + lifecycle { + # Until https://github.com/hashicorp/terraform-provider-google/issues/16804 is fixed + # ignore permadiff in ipv6_access_type for proxy_only subnets + ignore_changes = [ipv6_access_type] + } +} + resource "google_service_account" "service_account" { account_id = "e2e-service-account" project = google_project.project.project_id From 25128a35a8d5e101c4fe5a12a6729498d93603fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Niesiob=C4=99dzki?= Date: Sat, 6 Jan 2024 09:34:33 +0000 Subject: [PATCH 3/4] Enable E2E tests for net-lb-app-ext-regional HTTP to HTTPS needs work, now fails with: Error: Error creating ForwardingRule: googleapi: Error 400: Invalid value for field 'resource.IPAddress': '34.160.52.156'. Invalid IP address specified., invalid with module.ralb-test-0-redirect.google_compute_forwarding_rule.default, on fabric/modules/net-lb-app-ext-regional/main.tf line 32, in resource "google_compute_forwarding_rule" "default": 32: resource "google_compute_forwarding_rule" "default" { --- modules/net-lb-app-ext-regional/README.md | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/modules/net-lb-app-ext-regional/README.md b/modules/net-lb-app-ext-regional/README.md index b633047b4f..7d77ca52f2 100644 --- a/modules/net-lb-app-ext-regional/README.md +++ b/modules/net-lb-app-ext-regional/README.md @@ -51,7 +51,7 @@ module "glb-0" { } } } -# tftest modules=3 resources=9 fixtures=fixtures/compute-vm-group-bc.tf +# tftest modules=3 resources=9 fixtures=fixtures/compute-vm-group-bc.tf e2e ``` ### Minimal HTTPS examples @@ -106,7 +106,7 @@ module "ralb-0" { } } } -# tftest modules=3 resources=12 fixtures=fixtures/compute-vm-group-bc.tf +# tftest modules=3 resources=12 fixtures=fixtures/compute-vm-group-bc.tf e2e ``` #### HTTPS backends @@ -146,7 +146,7 @@ module "ralb-0" { } } } -# tftest modules=3 resources=12 fixtures=fixtures/ssl-certificate.tf,fixtures/compute-vm-group-bc.tf +# tftest modules=3 resources=12 fixtures=fixtures/ssl-certificate.tf,fixtures/compute-vm-group-bc.tf e2e ``` #### HTTP to HTTPS redirect @@ -209,7 +209,7 @@ module "ralb-test-0" { } } -# tftest modules=5 resources=16 fixtures=fixtures/ssl-certificate.tf,fixtures/compute-vm-group-bc.tf +# tftest modules=5 resources=16 fixtures=fixtures/ssl-certificate.tf,fixtures/compute-vm-group-bc.tf e2e ``` ### Health Checks @@ -242,7 +242,7 @@ module "ralb-0" { } } } -# tftest modules=3 resources=9 fixtures=fixtures/compute-vm-group-bc.tf +# tftest modules=3 resources=9 fixtures=fixtures/compute-vm-group-bc.tf e2e ``` To leverage existing health checks without having the module create them, simply pass their self links to backend services and set the `health_check_configs` variable to an empty map: @@ -259,7 +259,7 @@ module "ralb-0" { backends = [{ backend = module.compute-vm-group-b.group.id }] - health_checks = ["projects/${var.project_id}/global/healthChecks/custom"] + health_checks = ["projects/${var.project_id}/regions/${var.region}/healthChecks/custom"] } } health_check_configs = {} @@ -297,7 +297,7 @@ module "ralb-0" { } } } -# tftest modules=3 resources=10 fixtures=fixtures/compute-vm-group-bc.tf +# tftest modules=3 resources=10 fixtures=fixtures/compute-vm-group-bc.tf e2e ``` #### Managed Instance Groups @@ -361,7 +361,7 @@ module "ralb-0" { } } } -# tftest modules=3 resources=8 +# tftest modules=3 resources=8 e2e ``` #### Zonal NEG creation @@ -391,8 +391,8 @@ module "ralb-0" { neg_configs = { neg-0 = { gce = { - network = "projects/myprj-host/global/networks/svpc" - subnetwork = "projects/myprj-host/regions/europe-west8/subnetworks/gce" + network = var.vpc.self_link + subnetwork = var.subnet.self_link zone = "${var.region}-b" endpoints = { e-0 = { @@ -405,7 +405,7 @@ module "ralb-0" { } } } -# tftest modules=3 resources=11 fixtures=fixtures/compute-vm-group-bc.tf +# tftest modules=3 resources=11 fixtures=fixtures/compute-vm-group-bc.tf e2e ``` #### Hybrid NEG creation @@ -433,7 +433,7 @@ module "ralb-0" { neg_configs = { neg-0 = { hybrid = { - network = "projects/myprj-host/global/networks/svpc" + network = var.vpc.self_link zone = "${var.region}-b" endpoints = { e-0 = { @@ -445,7 +445,7 @@ module "ralb-0" { } } } -# tftest modules=1 resources=7 +# tftest modules=1 resources=7 e2e ``` #### Private Service Connect NEG creation @@ -476,7 +476,7 @@ module "ralb-0" { } } } -# tftest modules=1 resources=5 +# tftest modules=1 resources=5 e2e ``` #### Serverless NEG creation @@ -511,7 +511,7 @@ module "ralb-0" { } } } -# tftest modules=1 resources=5 +# tftest modules=1 resources=5 e2e ``` ### URL Map @@ -557,7 +557,7 @@ module "ralb-0" { } } -# tftest modules=3 resources=10 fixtures=fixtures/compute-vm-group-bc.tf +# tftest modules=3 resources=10 fixtures=fixtures/compute-vm-group-bc.tf e2e ``` ### Complex example @@ -687,7 +687,7 @@ module "ralb-0" { } } } -# tftest modules=3 resources=18 fixtures=fixtures/compute-vm-group-bc.tf +# tftest modules=3 resources=18 fixtures=fixtures/compute-vm-group-bc.tf e2e ``` From dc7c2e6fa3fe4ae04ebde367a360157b53f5f182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Niesiob=C4=99dzki?= Date: Sat, 6 Jan 2024 09:58:28 +0000 Subject: [PATCH 4/4] Fix HTTP to HTTPS example --- modules/net-address/README.md | 14 +++++++------- modules/net-address/main.tf | 1 + modules/net-address/variables.tf | 1 + modules/net-lb-app-ext-regional/README.md | 13 ++++++++----- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/modules/net-address/README.md b/modules/net-address/README.md index 02eb6458e3..eb07079db6 100644 --- a/modules/net-address/README.md +++ b/modules/net-address/README.md @@ -143,13 +143,13 @@ module "addresses" { | name | description | type | required | default | |---|---|:---:|:---:|:---:| -| [project_id](variables.tf#L83) | Project where the addresses will be created. | string | ✓ | | -| [external_addresses](variables.tf#L17) | Map of external addresses, keyed by name. | map(object({…})) | | {} | -| [global_addresses](variables.tf#L38) | List of global addresses to create. | map(object({…})) | | {} | -| [internal_addresses](variables.tf#L48) | Map of internal addresses to create, keyed by name. | map(object({…})) | | {} | -| [ipsec_interconnect_addresses](variables.tf#L64) | Map of internal addresses used for HPA VPN over Cloud Interconnect. | map(object({…})) | | {} | -| [psa_addresses](variables.tf#L88) | Map of internal addresses used for Private Service Access. | map(object({…})) | | {} | -| [psc_addresses](variables.tf#L101) | Map of internal addresses used for Private Service Connect. | map(object({…})) | | {} | +| [project_id](variables.tf#L84) | Project where the addresses will be created. | string | ✓ | | +| [external_addresses](variables.tf#L17) | Map of external addresses, keyed by name. | map(object({…})) | | {} | +| [global_addresses](variables.tf#L39) | List of global addresses to create. | map(object({…})) | | {} | +| [internal_addresses](variables.tf#L49) | Map of internal addresses to create, keyed by name. | map(object({…})) | | {} | +| [ipsec_interconnect_addresses](variables.tf#L65) | Map of internal addresses used for HPA VPN over Cloud Interconnect. | map(object({…})) | | {} | +| [psa_addresses](variables.tf#L89) | Map of internal addresses used for Private Service Access. | map(object({…})) | | {} | +| [psc_addresses](variables.tf#L102) | Map of internal addresses used for Private Service Connect. | map(object({…})) | | {} | ## Outputs diff --git a/modules/net-address/main.tf b/modules/net-address/main.tf index 9f9d52303a..a822f388b9 100644 --- a/modules/net-address/main.tf +++ b/modules/net-address/main.tf @@ -31,6 +31,7 @@ resource "google_compute_address" "external" { address_type = "EXTERNAL" ip_version = each.value.ipv6 != null ? "IPV6" : "IPV4" ipv6_endpoint_type = try(each.value.ipv6.endpoint_type, null) + network_tier = each.value.tier region = each.value.region labels = each.value.labels } diff --git a/modules/net-address/variables.tf b/modules/net-address/variables.tf index 5a6fd683b1..b0dbe58006 100644 --- a/modules/net-address/variables.tf +++ b/modules/net-address/variables.tf @@ -24,6 +24,7 @@ variable "external_addresses" { })) labels = optional(map(string), {}) name = optional(string) + tier = optional(string) })) default = {} validation { diff --git a/modules/net-lb-app-ext-regional/README.md b/modules/net-lb-app-ext-regional/README.md index 7d77ca52f2..21d6a0488c 100644 --- a/modules/net-lb-app-ext-regional/README.md +++ b/modules/net-lb-app-ext-regional/README.md @@ -157,8 +157,11 @@ Redirect is implemented via an additional HTTP load balancer with a custom URL m module "addresses" { source = "./fabric/modules/net-address" project_id = var.project_id - global_addresses = { - "ralb-test-0" = {} + external_addresses = { + "ralb-test-0" = { + region = var.region + tier = "STANDARD" + } } } @@ -169,7 +172,7 @@ module "ralb-test-0-redirect" { vpc = var.vpc.self_link region = var.region address = ( - module.addresses.global_addresses["ralb-test-0"].address + module.addresses.external_addresses["ralb-test-0"].id ) health_check_configs = {} urlmap_config = { @@ -188,7 +191,7 @@ module "ralb-test-0" { vpc = var.vpc.self_link region = var.region address = ( - module.addresses.global_addresses["ralb-test-0"].address + module.addresses.external_addresses["ralb-test-0"].id ) backend_service_configs = { default = { @@ -745,6 +748,6 @@ module "ralb-0" { ## Fixtures -- [compute-mig-bc.tf](../../tests/fixtures/compute-vm-group-bc.tf) +- [compute-vm-group-bc.tf](../../tests/fixtures/compute-vm-group-bc.tf) - [ssl-certificate.tf](../../tests/fixtures/ssl-certificate.tf)