From d29575562a6bed8ed477c30d43a788ca51af13ca Mon Sep 17 00:00:00 2001 From: Duda Martins <109083465+mariammartins@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:05:29 -0300 Subject: [PATCH] Fix: bucket name length exceeds 63 characters with non-US region deployment (#1347) --- 1-org/modules/cai-monitoring/main.tf | 2 +- 4-projects/modules/base_env/example_storage_cmek.tf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/1-org/modules/cai-monitoring/main.tf b/1-org/modules/cai-monitoring/main.tf index 22d6425ff..95f1761b1 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 = "~> 6.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 8b40250a7..cd10c2a38 100644 --- a/4-projects/modules/base_env/example_storage_cmek.tf +++ b/4-projects/modules/base_env/example_storage_cmek.tf @@ -44,11 +44,11 @@ resource "random_string" "bucket_name" { module "gcs_buckets" { source = "terraform-google-modules/cloud-storage/google//modules/simple_bucket" - version = "~> 6.0" + version = "~> 6.0.0" 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