From 7c7a1ef0b8d286ddb63a8b7574fbb44de01e64cb Mon Sep 17 00:00:00 2001 From: mariammartins Date: Wed, 9 Oct 2024 12:06:33 -0300 Subject: [PATCH] change in bucket name --- 1-org/modules/cai-monitoring/main.tf | 5 ++--- 4-projects/modules/base_env/example_storage_cmek.tf | 7 +------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/1-org/modules/cai-monitoring/main.tf b/1-org/modules/cai-monitoring/main.tf index 039444962..95f1761b1 100644 --- a/1-org/modules/cai-monitoring/main.tf +++ b/1-org/modules/cai-monitoring/main.tf @@ -26,8 +26,7 @@ locals { "run.googleapis.com", "eventarc.googleapis.com" ] - cai_source_name = var.random_suffix ? "CAI Monitoring - ${random_id.suffix.hex}" : "CAI Monitoring" - cai_monitoring_bucket_suffix = "${random_id.suffix.hex}-sources-${data.google_project.project.number}-${var.location}" + cai_source_name = var.random_suffix ? "CAI Monitoring - ${random_id.suffix.hex}" : "CAI Monitoring" } data "google_project" "project" { @@ -75,7 +74,7 @@ module "cloudfunction_source_bucket" { version = "~> 6.0" project_id = var.project_id - name = "bkt-cai-monitoring-${md5(local.cai_monitoring_bucket_suffix)}" + 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 cafde4143..cd10c2a38 100644 --- a/4-projects/modules/base_env/example_storage_cmek.tf +++ b/4-projects/modules/base_env/example_storage_cmek.tf @@ -14,11 +14,6 @@ * limitations under the License. */ -locals { - cmek_bucket_prefix = "${var.gcs_bucket_prefix}-cmek-encrypted" - cmek_bucket_suffix = "${module.base_shared_vpc_project.project_id}-${lower(var.location_gcs)}-${random_string.bucket_name.result}" -} - data "google_storage_project_service_account" "gcs_account" { project = module.base_shared_vpc_project.project_id } @@ -53,7 +48,7 @@ module "gcs_buckets" { project_id = module.base_shared_vpc_project.project_id location = var.location_gcs - name = "${local.cmek_bucket_prefix}-${md5(local.cmek_bucket_suffix)}" + 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