From f140adfab831040db4fa0282e5056cb3073778f5 Mon Sep 17 00:00:00 2001 From: Julio Castillo Date: Sat, 16 Nov 2024 11:14:47 +0100 Subject: [PATCH] Remove REGIONAL/MULTI_REGIONAL buckets from FAST (#2697) --- fast/stages/1-resman/main.tf | 5 ----- .../1-resman/stage-2-network-security.tf | 15 +++++++-------- fast/stages/1-resman/stage-2-networking.tf | 15 +++++++-------- .../stages/1-resman/stage-2-project-factory.tf | 15 +++++++-------- fast/stages/1-resman/stage-2-security.tf | 15 +++++++-------- fast/stages/1-resman/stage-3.tf | 15 +++++++-------- tests/fast/stages/s1_resman/simple.yaml | 18 +++++++++--------- 7 files changed, 44 insertions(+), 54 deletions(-) diff --git a/fast/stages/1-resman/main.tf b/fast/stages/1-resman/main.tf index 6d96689bb..fbff1284e 100644 --- a/fast/stages/1-resman/main.tf +++ b/fast/stages/1-resman/main.tf @@ -20,11 +20,6 @@ locals { # data.google_client_openid_userinfo.provider_identity[0].email, null # ) # tag values use descriptive names - gcs_storage_class = ( - length(split("-", var.locations.gcs)) < 2 - ? "MULTI_REGIONAL" - : "REGIONAL" - ) identity_providers = coalesce( try(var.automation.federated_identity_providers, null), {} ) diff --git a/fast/stages/1-resman/stage-2-network-security.tf b/fast/stages/1-resman/stage-2-network-security.tf index d639bebfe..e0679a545 100644 --- a/fast/stages/1-resman/stage-2-network-security.tf +++ b/fast/stages/1-resman/stage-2-network-security.tf @@ -59,14 +59,13 @@ module "nsec-sa-ro" { # automation bucket module "nsec-bucket" { - source = "../../../modules/gcs" - count = var.fast_stage_2.network_security.enabled ? 1 : 0 - project_id = var.automation.project_id - name = "resman-${var.fast_stage_2.network_security.short_name}-0" - prefix = var.prefix - location = var.locations.gcs - storage_class = local.gcs_storage_class - versioning = true + source = "../../../modules/gcs" + count = var.fast_stage_2.network_security.enabled ? 1 : 0 + project_id = var.automation.project_id + name = "resman-${var.fast_stage_2.network_security.short_name}-0" + prefix = var.prefix + location = var.locations.gcs + versioning = true iam = { "roles/storage.objectAdmin" = [module.nsec-sa-rw[0].iam_email] "roles/storage.objectViewer" = [module.nsec-sa-ro[0].iam_email] diff --git a/fast/stages/1-resman/stage-2-networking.tf b/fast/stages/1-resman/stage-2-networking.tf index ccdb4d5be..23c45a834 100644 --- a/fast/stages/1-resman/stage-2-networking.tf +++ b/fast/stages/1-resman/stage-2-networking.tf @@ -225,14 +225,13 @@ module "net-sa-ro" { # automation bucket module "net-bucket" { - source = "../../../modules/gcs" - count = var.fast_stage_2.networking.enabled ? 1 : 0 - project_id = var.automation.project_id - name = "prod-resman-${var.fast_stage_2.networking.short_name}-0" - prefix = var.prefix - location = var.locations.gcs - storage_class = local.gcs_storage_class - versioning = true + source = "../../../modules/gcs" + count = var.fast_stage_2.networking.enabled ? 1 : 0 + project_id = var.automation.project_id + name = "prod-resman-${var.fast_stage_2.networking.short_name}-0" + prefix = var.prefix + location = var.locations.gcs + versioning = true iam = { "roles/storage.objectAdmin" = [module.net-sa-rw[0].iam_email] "roles/storage.objectViewer" = [module.net-sa-ro[0].iam_email] diff --git a/fast/stages/1-resman/stage-2-project-factory.tf b/fast/stages/1-resman/stage-2-project-factory.tf index 129c8bc69..f001c3cd0 100644 --- a/fast/stages/1-resman/stage-2-project-factory.tf +++ b/fast/stages/1-resman/stage-2-project-factory.tf @@ -59,14 +59,13 @@ module "pf-sa-ro" { # automation bucket module "pf-bucket" { - source = "../../../modules/gcs" - count = var.fast_stage_2.project_factory.enabled ? 1 : 0 - project_id = var.automation.project_id - name = "resman-${var.fast_stage_2.project_factory.short_name}-0" - prefix = var.prefix - location = var.locations.gcs - storage_class = local.gcs_storage_class - versioning = true + source = "../../../modules/gcs" + count = var.fast_stage_2.project_factory.enabled ? 1 : 0 + project_id = var.automation.project_id + name = "resman-${var.fast_stage_2.project_factory.short_name}-0" + prefix = var.prefix + location = var.locations.gcs + versioning = true iam = { "roles/storage.objectAdmin" = [module.pf-sa-rw[0].iam_email] "roles/storage.objectViewer" = [module.pf-sa-ro[0].iam_email] diff --git a/fast/stages/1-resman/stage-2-security.tf b/fast/stages/1-resman/stage-2-security.tf index dce6e0d0d..980295114 100644 --- a/fast/stages/1-resman/stage-2-security.tf +++ b/fast/stages/1-resman/stage-2-security.tf @@ -208,14 +208,13 @@ module "sec-sa-ro" { # automation bucket module "sec-bucket" { - source = "../../../modules/gcs" - count = var.fast_stage_2.security.enabled ? 1 : 0 - project_id = var.automation.project_id - name = "prod-resman-${var.fast_stage_2.security.short_name}-0" - prefix = var.prefix - location = var.locations.gcs - storage_class = local.gcs_storage_class - versioning = true + source = "../../../modules/gcs" + count = var.fast_stage_2.security.enabled ? 1 : 0 + project_id = var.automation.project_id + name = "prod-resman-${var.fast_stage_2.security.short_name}-0" + prefix = var.prefix + location = var.locations.gcs + versioning = true iam = { "roles/storage.objectAdmin" = [module.sec-sa-rw[0].iam_email] "roles/storage.objectViewer" = [module.sec-sa-ro[0].iam_email] diff --git a/fast/stages/1-resman/stage-3.tf b/fast/stages/1-resman/stage-3.tf index 2015c61f7..9e03b48f0 100644 --- a/fast/stages/1-resman/stage-3.tf +++ b/fast/stages/1-resman/stage-3.tf @@ -199,14 +199,13 @@ module "stage3-sa-ro" { # automation bucket module "stage3-bucket" { - source = "../../../modules/gcs" - for_each = local.stage3 - project_id = var.automation.project_id - name = "resman-${each.value.short_name}-0" - prefix = "${var.prefix}-${each.value.environment}" - location = var.locations.gcs - storage_class = local.gcs_storage_class - versioning = true + source = "../../../modules/gcs" + for_each = local.stage3 + project_id = var.automation.project_id + name = "resman-${each.value.short_name}-0" + prefix = "${var.prefix}-${each.value.environment}" + location = var.locations.gcs + versioning = true iam = { "roles/storage.objectAdmin" = [module.stage3-sa-rw[each.key].iam_email] "roles/storage.objectViewer" = [module.stage3-sa-ro[each.key].iam_email] diff --git a/tests/fast/stages/s1_resman/simple.yaml b/tests/fast/stages/s1_resman/simple.yaml index b81b71092..ba844c38e 100644 --- a/tests/fast/stages/s1_resman/simple.yaml +++ b/tests/fast/stages/s1_resman/simple.yaml @@ -115,7 +115,7 @@ values: project: fast2-prod-automation requester_pays: null retention_policy: [] - storage_class: MULTI_REGIONAL + storage_class: STANDARD terraform_labels: goog-terraform-provisioned: 'true' timeouts: null @@ -544,7 +544,7 @@ values: project: fast2-prod-automation requester_pays: null retention_policy: [] - storage_class: MULTI_REGIONAL + storage_class: STANDARD terraform_labels: goog-terraform-provisioned: 'true' timeouts: null @@ -621,7 +621,7 @@ values: project: fast2-prod-automation requester_pays: null retention_policy: [] - storage_class: MULTI_REGIONAL + storage_class: STANDARD terraform_labels: goog-terraform-provisioned: 'true' timeouts: null @@ -775,7 +775,7 @@ values: project: fast2-prod-automation requester_pays: null retention_policy: [] - storage_class: MULTI_REGIONAL + storage_class: STANDARD terraform_labels: goog-terraform-provisioned: 'true' timeouts: null @@ -812,7 +812,7 @@ values: project: fast2-prod-automation requester_pays: null retention_policy: [] - storage_class: MULTI_REGIONAL + storage_class: STANDARD terraform_labels: goog-terraform-provisioned: 'true' timeouts: null @@ -849,7 +849,7 @@ values: project: fast2-prod-automation requester_pays: null retention_policy: [] - storage_class: MULTI_REGIONAL + storage_class: STANDARD terraform_labels: goog-terraform-provisioned: 'true' timeouts: null @@ -886,7 +886,7 @@ values: project: fast2-prod-automation requester_pays: null retention_policy: [] - storage_class: MULTI_REGIONAL + storage_class: STANDARD terraform_labels: goog-terraform-provisioned: 'true' timeouts: null @@ -923,7 +923,7 @@ values: project: fast2-prod-automation requester_pays: null retention_policy: [] - storage_class: MULTI_REGIONAL + storage_class: STANDARD terraform_labels: goog-terraform-provisioned: 'true' timeouts: null @@ -960,7 +960,7 @@ values: project: fast2-prod-automation requester_pays: null retention_policy: [] - storage_class: MULTI_REGIONAL + storage_class: STANDARD terraform_labels: goog-terraform-provisioned: 'true' timeouts: null