From 279c39bf9766b95066e598326cb6ef7ff1654324 Mon Sep 17 00:00:00 2001 From: Amanda Karina Lopes de Oliveira Date: Fri, 16 Aug 2024 10:28:27 -0300 Subject: [PATCH] Fixes business_unit_2 commands --- 4-projects/README.md | 14 ++++++++------ 4-projects/business_unit_1/development/main.tf | 1 + 4-projects/business_unit_1/nonproduction/main.tf | 1 + 4-projects/business_unit_1/production/main.tf | 1 + 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/4-projects/README.md b/4-projects/README.md index 914863ddf..808d03e0c 100644 --- a/4-projects/README.md +++ b/4-projects/README.md @@ -144,9 +144,10 @@ For example, to create a new business unit similar to business_unit_1, run the f # search all files under the folder `business_unit_2` and replace strings for business_unit_1 with strings for business_unit_2 grep -rl bu1 business_unit_2/ | xargs sed -i 's/bu1/bu2/g' grep -rl business_unit_1 business_unit_2/ | xargs sed -i 's/business_unit_1/business_unit_2/g' + # search subnet_ip_range 10.3.64.0 and replace for the new range 10.4.64.0 + grep -rl 10.3.64.0 business_unit_2/ | xargs sed -i 's/10.3.64.0/10.4.64.0/g' ``` - 1. Commit changes. ```bash @@ -187,14 +188,14 @@ For example, to create a new business unit similar to business_unit_1, run the f 1. Push your plan branch to trigger a plan for all environments. Because the _plan_ branch is not a [named environment branch](../docs/FAQ.md#what-is-a-named-branch)), pushing your _plan_ - branch triggers _terraform plan_ but not _terraform apply_. Review the plan output in your Cloud Build project https://console.cloud.google.com/cloud-build/builds;region=DEFAULT_REGION?project=YOUR_CLOUD_BUILD_PROJECT_ID + branch triggers _terraform plan_ but not _terraform apply_. Review the plan output in your Cloud Build project ```bash git push --set-upstream origin plan ``` 1. Merge changes to production. Because this is a [named environment branch](../docs/FAQ.md#what-is-a-named-branch), - pushing to this branch triggers both _terraform plan_ and _terraform apply_. Review the apply output in your Cloud Build project. https://console.cloud.google.com/cloud-build/builds;region=DEFAULT_REGION?project=YOUR_CLOUD_BUILD_PROJECT_ID + pushing to this branch triggers both _terraform plan_ and _terraform apply_. Review the apply output in your Cloud Build project. ```bash git checkout -b production @@ -203,7 +204,7 @@ For example, to create a new business unit similar to business_unit_1, run the f 1. After production has been applied, apply development. 1. Merge changes to development. Because this is a [named environment branch](../docs/FAQ.md#what-is-a-named-branch), - pushing to this branch triggers both _terraform plan_ and _terraform apply_. Review the apply output in your Cloud Build project https://console.cloud.google.com/cloud-build/builds;region=DEFAULT_REGION?project=YOUR_CLOUD_BUILD_PROJECT_ID + pushing to this branch triggers both _terraform plan_ and _terraform apply_. Review the apply output in your Cloud Build project ```bash git checkout -b development @@ -212,7 +213,7 @@ For example, to create a new business unit similar to business_unit_1, run the f 1. After development has been applied, apply nonproduction. 1. Merge changes to nonproduction. Because this is a [named environment branch](../docs/FAQ.md#what-is-a-named-branch), - pushing to this branch triggers both _terraform plan_ and _terraform apply_. Review the apply output in your Cloud Build project. https://console.cloud.google.com/cloud-build/builds;region=DEFAULT_REGION?project=YOUR_CLOUD_BUILD_PROJECT_ID + pushing to this branch triggers both _terraform plan_ and _terraform apply_. Review the apply output in your Cloud Build project. ```bash git checkout -b nonproduction @@ -292,9 +293,10 @@ For example, to create a new business unit similar to business_unit_1, run the f # search all files under the folder `business_unit_2` and replace strings for business_unit_1 with strings for business_unit_2 grep -rl bu1 business_unit_2/ | xargs sed -i 's/bu1/bu2/g' grep -rl business_unit_1 business_unit_2/ | xargs sed -i 's/business_unit_1/business_unit_2/g' + # search subnet_ip_range 10.3.64.0 and replace for the new range 10.4.64.0 + grep -rl 10.3.64.0 business_unit_2/ | xargs sed -i 's/10.3.64.0/10.4.64.0/g' ``` - 1. Run `init` and `plan` and review output for environment shared. ```bash diff --git a/4-projects/business_unit_1/development/main.tf b/4-projects/business_unit_1/development/main.tf index b2efde30d..e03ab8209 100644 --- a/4-projects/business_unit_1/development/main.tf +++ b/4-projects/business_unit_1/development/main.tf @@ -23,6 +23,7 @@ module "env" { remote_state_bucket = var.remote_state_bucket location_kms = coalesce(var.location_kms, local.default_region_kms) location_gcs = coalesce(var.location_gcs, local.default_region_gcs) + keyring_name = "bu1-sample-keyring" gcs_custom_placement_config = { data_locations = [ upper(local.default_region), diff --git a/4-projects/business_unit_1/nonproduction/main.tf b/4-projects/business_unit_1/nonproduction/main.tf index ef954c892..b16bd8a4c 100644 --- a/4-projects/business_unit_1/nonproduction/main.tf +++ b/4-projects/business_unit_1/nonproduction/main.tf @@ -22,6 +22,7 @@ module "env" { business_unit = "business_unit_1" remote_state_bucket = var.remote_state_bucket location_kms = coalesce(var.location_kms, local.default_region_kms) + keyring_name = "bu1-sample-keyring" location_gcs = coalesce(var.location_gcs, local.default_region_gcs) gcs_custom_placement_config = { data_locations = [ diff --git a/4-projects/business_unit_1/production/main.tf b/4-projects/business_unit_1/production/main.tf index cdc136052..fab79745d 100644 --- a/4-projects/business_unit_1/production/main.tf +++ b/4-projects/business_unit_1/production/main.tf @@ -22,6 +22,7 @@ module "env" { business_unit = "business_unit_1" remote_state_bucket = var.remote_state_bucket location_kms = coalesce(var.location_kms, local.default_region_kms) + keyring_name = "bu1-sample-keyring" location_gcs = coalesce(var.location_gcs, local.default_region_gcs) gcs_custom_placement_config = { data_locations = [