Skip to content

Commit

Permalink
change in bucket name
Browse files Browse the repository at this point in the history
  • Loading branch information
mariammartins committed Oct 9, 2024
1 parent bdb467d commit 7c7a1ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
5 changes: 2 additions & 3 deletions 1-org/modules/cai-monitoring/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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
Expand Down
7 changes: 1 addition & 6 deletions 4-projects/modules/base_env/example_storage_cmek.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 7c7a1ef

Please sign in to comment.