terraform-example-foundation icon indicating copy to clipboard operation
terraform-example-foundation copied to clipboard

Location set in bootstrap is ignored - resources still deployed in us-central1 and us-west1

Open mromascanu123 opened this issue 1 year ago • 3 comments

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 image

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

mromascanu123 avatar Mar 22 '24 13:03 mromascanu123

reverify after pulling also a related fix in https://github.com/terraform-google-modules/terraform-example-foundation/pull/1181

fmichaelobrien avatar Apr 03 '24 20:04 fmichaelobrien

stale bot timer restart - https://github.com/terraform-google-modules/terraform-example-foundation/blob/master/.github/workflows/stale.yml#L21

fmichaelobrien avatar Apr 11 '24 15:04 fmichaelobrien

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"

fmichaelobrien avatar Apr 11 '24 16:04 fmichaelobrien

#1181 is merged

eeaton avatar May 29 '24 13:05 eeaton