terraform-example-foundation
terraform-example-foundation copied to clipboard
Location set in bootstrap is ignored - resources still deployed in us-central1 and us-west1
TL;DR
Deployed with default_region = "northamerica-northeast2" in 0-bootstrap / terraform.auto.tfvars. Despite this (too many to enumerate) resources still deployed in us-central1 and us-west1. This is caused by module defaults (set in variables.tf) not being overriden when modules invoked from above
Expected behavior
Everything should be deployed in the specified region (or regions). However in terraform.auto.tfvars in 0-bootstrap we can specify a single region - while the deployment by default we specify a single region. Should have the deployment deploy in a single region, or 2 regions based exclusively on what was specified in bootstrap
Observed behavior
Here are a few examples
Terraform Configuration
0-bootstrap / terraform.auto.tfvars
org_id = "946...etc" # format "000000000000"
billing_account = "01A5... etc" # format "000000-000000-000000"
... etc...
default_region = "northamerica-northeast2"
Terraform Version
[user@linuxbox ~]$ terraform version
Terraform v1.6.0
on linux_amd64
Additional information
Please fix region parameterization, having resources in multiple regions will make costs explode not to mention regulatory issues with data localization
reverify after pulling also a related fix in https://github.com/terraform-google-modules/terraform-example-foundation/pull/1181
stale bot timer restart - https://github.com/terraform-google-modules/terraform-example-foundation/blob/master/.github/workflows/stale.yml#L21
verify as well 3-networks-hub-and-spoke
https://github.com/terraform-google-modules/terraform-example-foundation/blob/master/3-networks-hub-and-spoke/envs/shared/main.tf#L22
locals {
env = "common"
environment_code = "c"
bgp_asn_number = var.enable_partner_interconnect ? "16550" : "64514"
dns_bgp_asn_number = var.enable_partner_interconnect ? "16550" : var.bgp_asn_dns
default_region1 = "us-west1"
default_region2 = "us-central1"
#1181 is merged