Skip to content

Commit

Permalink
fix: use bootstrap.outputs.common_config as default in 3-networks-hub…
Browse files Browse the repository at this point in the history
…-and-spoke
  • Loading branch information
nbugden committed Apr 11, 2024
1 parent b67f320 commit 7c4409f
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 8 deletions.
4 changes: 2 additions & 2 deletions 3-networks-hub-and-spoke/envs/development/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
locals {
env = "development"
environment_code = substr(local.env, 0, 1)
default_region1 = "us-west1"
default_region2 = "us-central1"
default_region1 = data.terraform_remote_state.bootstrap.outputs.common_config.default_region
default_region2 = data.terraform_remote_state.bootstrap.outputs.common_config.default_region_2
/*
* Base network ranges
*/
Expand Down
24 changes: 24 additions & 0 deletions 3-networks-hub-and-spoke/envs/development/remote.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

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

config = {
bucket = var.remote_state_bucket
prefix = "terraform/bootstrap/state"
}
}
4 changes: 2 additions & 2 deletions 3-networks-hub-and-spoke/envs/nonproduction/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
locals {
env = "nonproduction"
environment_code = substr(local.env, 0, 1)
default_region1 = "us-west1"
default_region2 = "us-central1"
default_region1 = data.terraform_remote_state.bootstrap.outputs.common_config.default_region
default_region2 = data.terraform_remote_state.bootstrap.outputs.common_config.default_region_2
/*
* Base network ranges
*/
Expand Down
24 changes: 24 additions & 0 deletions 3-networks-hub-and-spoke/envs/nonproduction/remote.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

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

config = {
bucket = var.remote_state_bucket
prefix = "terraform/bootstrap/state"
}
}
4 changes: 2 additions & 2 deletions 3-networks-hub-and-spoke/envs/production/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
locals {
env = "production"
environment_code = substr(local.env, 0, 1)
default_region1 = "us-west1"
default_region2 = "us-central1"
default_region1 = data.terraform_remote_state.bootstrap.outputs.common_config.default_region
default_region2 = data.terraform_remote_state.bootstrap.outputs.common_config.default_region_2
/*
* Base network ranges
*/
Expand Down
24 changes: 24 additions & 0 deletions 3-networks-hub-and-spoke/envs/production/remote.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

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

config = {
bucket = var.remote_state_bucket
prefix = "terraform/bootstrap/state"
}
}
2 changes: 0 additions & 2 deletions 3-networks-hub-and-spoke/envs/shared/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ locals {
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"

dedicated_interconnect_egress_policy = var.enable_dedicated_interconnect ? [
{
Expand Down
2 changes: 2 additions & 0 deletions 3-networks-hub-and-spoke/envs/shared/remote.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ locals {
org_id = data.terraform_remote_state.bootstrap.outputs.common_config.org_id
billing_account = data.terraform_remote_state.bootstrap.outputs.common_config.billing_account
default_region = data.terraform_remote_state.bootstrap.outputs.common_config.default_region
default_region1 = data.terraform_remote_state.bootstrap.outputs.common_config.default_region
default_region2 = data.terraform_remote_state.bootstrap.outputs.common_config.default_region_2
project_prefix = data.terraform_remote_state.bootstrap.outputs.common_config.project_prefix
folder_prefix = data.terraform_remote_state.bootstrap.outputs.common_config.folder_prefix
parent_id = data.terraform_remote_state.bootstrap.outputs.common_config.parent_id
Expand Down

0 comments on commit 7c4409f

Please sign in to comment.