Skip to content

Commit

Permalink
fix: use 4-projects output as default region for 5-app-infra
Browse files Browse the repository at this point in the history
  • Loading branch information
nbugden committed May 7, 2024
1 parent b47db92 commit 7989afe
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 18 deletions.
5 changes: 5 additions & 0 deletions 4-projects/business_unit_1/development/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,8 @@ output "iap_firewall_tags" {
description = "The security tags created for IAP (SSH and RDP) firewall rules and to be used on the VM created on step 5-app-infra on the peering network project."
value = module.env.iap_firewall_tags
}

output "default_region" {
description = "The default region for the project."
value = local.default_region
}
10 changes: 10 additions & 0 deletions 4-projects/business_unit_1/nonproduction/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,13 @@ output "iap_firewall_tags" {
description = "The security tags created for IAP (SSH and RDP) firewall rules and to be used on the VM created on step 5-app-infra on the peering network project."
value = module.env.iap_firewall_tags
}

output "default_region" {
description = "The default region for the project."
value = local.default_region
}

output "default_region" {
description = "The default region for the project."
value = local.default_region
}
6 changes: 6 additions & 0 deletions 4-projects/business_unit_1/production/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,9 @@ output "iap_firewall_tags" {
description = "The security tags created for IAP (SSH and RDP) firewall rules and to be used on the VM created on step 5-app-infra on the peering network project."
value = module.env.iap_firewall_tags
}

output "default_region" {
description = "The default region for the project."
value = local.default_region
}

6 changes: 6 additions & 0 deletions 4-projects/business_unit_2/development/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,9 @@ output "iap_firewall_tags" {
description = "The security tags created for IAP (SSH and RDP) firewall rules and to be used on the VM created on step 5-app-infra on the peering network project."
value = module.env.iap_firewall_tags
}

output "default_region" {
description = "The default region for the project."
value = local.default_region
}

6 changes: 6 additions & 0 deletions 4-projects/business_unit_2/nonproduction/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,9 @@ output "iap_firewall_tags" {
description = "The security tags created for IAP (SSH and RDP) firewall rules and to be used on the VM created on step 5-app-infra on the peering network project."
value = module.env.iap_firewall_tags
}

output "default_region" {
description = "The default region for the project."
value = local.default_region
}

5 changes: 5 additions & 0 deletions 4-projects/business_unit_2/production/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,8 @@ output "iap_firewall_tags" {
description = "The security tags created for IAP (SSH and RDP) firewall rules and to be used on the VM created on step 5-app-infra on the peering network project."
value = module.env.iap_firewall_tags
}

output "default_region" {
description = "The default region for the project."
value = local.default_region
}
6 changes: 3 additions & 3 deletions 5-app-infra/business_unit_1/development/remote.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
*/

locals {
default_region = data.terraform_remote_state.bootstrap.outputs.common_config.default_region
default_region = data.terraform_remote_state.projects_env.outputs.default_region
}

data "terraform_remote_state" "bootstrap" {
data "terraform_remote_state" "projects_env" {
backend = "gcs"

config = {
bucket = var.remote_state_bucket
prefix = "terraform/bootstrap/state"
prefix = "terraform/projects/${local.business_unit}/${local.environment}"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/

locals {
default_region = data.tfe_outputs.bootstrap.outputs.common_config.default_region
default_region = data.tfe_outputs.projects.outputs.default_region
}

data "tfe_outputs" "bootstrap" {
data "tfe_outputs" "projects" {
organization = var.tfc_org_name
workspace = "0-shared"
workspace = "4-projects"
}
6 changes: 3 additions & 3 deletions 5-app-infra/business_unit_1/nonproduction/remote.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
*/

locals {
default_region = data.terraform_remote_state.bootstrap.outputs.common_config.default_region
default_region = data.terraform_remote_state.projects_env.outputs.default_region
}

data "terraform_remote_state" "bootstrap" {
data "terraform_remote_state" "projects_env" {
backend = "gcs"

config = {
bucket = var.remote_state_bucket
prefix = "terraform/bootstrap/state"
prefix = "terraform/projects/${local.business_unit}/${local.environment}"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/

locals {
default_region = data.tfe_outputs.bootstrap.outputs.common_config.default_region
default_region = data.tfe_outputs.projects.outputs.default_region
}

data "tfe_outputs" "bootstrap" {
data "tfe_outputs" "projects" {
organization = var.tfc_org_name
workspace = "0-shared"
workspace = "4-projects"
}
8 changes: 5 additions & 3 deletions 5-app-infra/business_unit_1/production/remote.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
*/

locals {
default_region = data.terraform_remote_state.bootstrap.outputs.common_config.default_region
default_region = data.terraform_remote_state.projects_env.outputs.default_region
}

data "terraform_remote_state" "bootstrap" {
data "terraform_remote_state" "projects_env" {
backend = "gcs"

config = {
bucket = var.remote_state_bucket
prefix = "terraform/bootstrap/state"
prefix = "terraform/projects/${local.business_unit}/${local.environment}"
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/

locals {
default_region = data.tfe_outputs.bootstrap.outputs.common_config.default_region
default_region = data.tfe_outputs.projects.outputs.default_region
}

data "tfe_outputs" "bootstrap" {
data "tfe_outputs" "projects" {
organization = var.tfc_org_name
workspace = "0-shared"
workspace = "4-projects"
}

0 comments on commit 7989afe

Please sign in to comment.