diff --git a/1-org/modules/cai-monitoring/main.tf b/1-org/modules/cai-monitoring/main.tf index a7261493b..8a76ab17d 100644 --- a/1-org/modules/cai-monitoring/main.tf +++ b/1-org/modules/cai-monitoring/main.tf @@ -74,7 +74,7 @@ module "cloudfunction_source_bucket" { version = "~> 8.0" project_id = var.project_id - name = "bkt-cai-monitoring-${random_id.suffix.hex}-sources-${data.google_project.project.number}-${var.location}" + name = "bkt-cai-monitoring-${random_id.suffix.hex}-sources-${data.google_project.project.number}" location = var.location storage_class = "REGIONAL" force_destroy = true diff --git a/4-projects/modules/base_env/example_storage_cmek.tf b/4-projects/modules/base_env/example_storage_cmek.tf index 2256e2a54..f9a77c08b 100644 --- a/4-projects/modules/base_env/example_storage_cmek.tf +++ b/4-projects/modules/base_env/example_storage_cmek.tf @@ -48,7 +48,7 @@ module "gcs_buckets" { project_id = module.base_shared_vpc_project.project_id location = var.location_gcs - name = "${var.gcs_bucket_prefix}-${module.base_shared_vpc_project.project_id}-${lower(var.location_gcs)}-cmek-encrypted-${random_string.bucket_name.result}" + name = "${var.gcs_bucket_prefix}-${module.base_shared_vpc_project.project_id}-cmek-encrypted-${random_string.bucket_name.result}" bucket_policy_only = true custom_placement_config = var.gcs_custom_placement_config diff --git a/helpers/foundation-deployer/README.md b/helpers/foundation-deployer/README.md index dc60a66a4..6c5cc1048 100644 --- a/helpers/foundation-deployer/README.md +++ b/helpers/foundation-deployer/README.md @@ -11,6 +11,7 @@ Helper tool to deploy the Terraform example foundation using Cloud Build and Clo - [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) version 2.28.0 or later - [Terraform](https://www.terraform.io/downloads.html) version 1.5.7 or later - See `0-bootstrap` README for additional IAM [requirements](../../0-bootstrap/README.md#prerequisites) on the user deploying the Foundation. +- To enable Security Command Center, choose a Security Command Center tier and create and grant permissions for the Security Command Center service account as described in [Setting up Security Command Center](https://cloud.google.com/security-command-center/docs/quickstart-security-command-center). Your environment need to use the same [Terraform](https://www.terraform.io/downloads.html) version used on the build pipeline. Otherwise, you might experience Terraform state snapshot lock errors. diff --git a/helpers/foundation-deployer/global.tfvars.example b/helpers/foundation-deployer/global.tfvars.example index f86186d01..b9ab862de 100644 --- a/helpers/foundation-deployer/global.tfvars.example +++ b/helpers/foundation-deployer/global.tfvars.example @@ -144,5 +144,5 @@ target_name_server_addresses = [ // Can be used to override the default region set in 0-bootstrap // See https://github.com/terraform-google-modules/terraform-example-foundation/blob/master/4-projects/business_unit_1/production/README.md#outputs -gcs_location = "US" -kms_location = "us" +location_kms = "us" +location_gcs = "US" diff --git a/helpers/foundation-deployer/stages/apply.go b/helpers/foundation-deployer/stages/apply.go index 0e9d26648..d48083083 100644 --- a/helpers/foundation-deployer/stages/apply.go +++ b/helpers/foundation-deployer/stages/apply.go @@ -344,8 +344,8 @@ func DeployProjectsStage(t testing.TB, s steps.Steps, tfvars GlobalTFVars, outpu } //for each environment envTfvars := ProjEnvTfvars{ - ProjectsKMSLocation: tfvars.ProjectsKMSLocation, - ProjectsGCSLocation: tfvars.ProjectsGCSLocation, + LocationKMS: tfvars.LocationKMS, + LocationGCS: tfvars.LocationGCS, FolderDeletionProtection: tfvars.FolderDeletionProtection, ProjectDeletionPolicy: tfvars.ProjectDeletionPolicy, } diff --git a/helpers/foundation-deployer/stages/data.go b/helpers/foundation-deployer/stages/data.go index d1289aa46..a3b64687c 100644 --- a/helpers/foundation-deployer/stages/data.go +++ b/helpers/foundation-deployer/stages/data.go @@ -152,8 +152,8 @@ type GlobalTFVars struct { EnableHubAndSpoke bool `hcl:"enable_hub_and_spoke"` EnableHubAndSpokeTransitivity bool `hcl:"enable_hub_and_spoke_transitivity"` CreateUniqueTagKey bool `hcl:"create_unique_tag_key"` - ProjectsKMSLocation string `hcl:"projects_kms_location"` - ProjectsGCSLocation string `hcl:"projects_gcs_location"` + LocationKMS string `hcl:"location_kms"` + LocationGCS string `hcl:"location_gcs"` CodeCheckoutPath string `hcl:"code_checkout_path"` FoundationCodePath string `hcl:"foundation_code_path"` ValidatorProjectId *string `hcl:"validator_project_id"` @@ -258,8 +258,8 @@ type ProjSharedTfvars struct { } type ProjEnvTfvars struct { - ProjectsKMSLocation string `hcl:"projects_kms_location"` - ProjectsGCSLocation string `hcl:"projects_gcs_location"` + LocationKMS string `hcl:"location_kms"` + LocationGCS string `hcl:"location_gcs"` FolderDeletionProtection bool `hcl:"folder_deletion_protection"` ProjectDeletionPolicy string `hcl:"project_deletion_policy"` }