From d931d6ffe4edc2328b361efc68bbdfbb9abf53f9 Mon Sep 17 00:00:00 2001 From: Elliot Date: Fri, 21 Jun 2024 10:48:41 +0000 Subject: [PATCH] remove extraneous module.env_kms_project and its outputs, these should not be used. replace references to it with module.env_kms configured in Stage 2. --- .../business_unit_1/development/outputs.tf | 5 ---- .../business_unit_1/nonproduction/outputs.tf | 5 ---- .../business_unit_1/production/outputs.tf | 5 ---- .../modules/base_env/example_storage_cmek.tf | 23 +------------------ 4-projects/modules/base_env/outputs.tf | 5 ---- 4-projects/modules/base_env/remote.tf | 1 + 6 files changed, 2 insertions(+), 42 deletions(-) diff --git a/4-projects/business_unit_1/development/outputs.tf b/4-projects/business_unit_1/development/outputs.tf index feef5c507..92a332bc6 100644 --- a/4-projects/business_unit_1/development/outputs.tf +++ b/4-projects/business_unit_1/development/outputs.tf @@ -79,11 +79,6 @@ output "peering_complete" { value = module.env.peering_complete } -output "env_kms_project" { - description = "Project sample for KMS usage project ID." - value = module.env.env_kms_project -} - output "keyring" { description = "The name of the keyring." value = module.env.keyring diff --git a/4-projects/business_unit_1/nonproduction/outputs.tf b/4-projects/business_unit_1/nonproduction/outputs.tf index feef5c507..92a332bc6 100644 --- a/4-projects/business_unit_1/nonproduction/outputs.tf +++ b/4-projects/business_unit_1/nonproduction/outputs.tf @@ -79,11 +79,6 @@ output "peering_complete" { value = module.env.peering_complete } -output "env_kms_project" { - description = "Project sample for KMS usage project ID." - value = module.env.env_kms_project -} - output "keyring" { description = "The name of the keyring." value = module.env.keyring diff --git a/4-projects/business_unit_1/production/outputs.tf b/4-projects/business_unit_1/production/outputs.tf index e8a821c7b..55b839cb4 100644 --- a/4-projects/business_unit_1/production/outputs.tf +++ b/4-projects/business_unit_1/production/outputs.tf @@ -79,11 +79,6 @@ output "peering_complete" { value = module.env.peering_complete } -output "env_kms_project" { - description = "Project sample for KMS usage project ID." - value = module.env.env_kms_project -} - output "keyring" { description = "The name of the keyring." value = module.env.keyring diff --git a/4-projects/modules/base_env/example_storage_cmek.tf b/4-projects/modules/base_env/example_storage_cmek.tf index f72e15d42..8b40250a7 100644 --- a/4-projects/modules/base_env/example_storage_cmek.tf +++ b/4-projects/modules/base_env/example_storage_cmek.tf @@ -14,27 +14,6 @@ * limitations under the License. */ -module "env_kms_project" { - source = "../single_project" - - org_id = local.org_id - billing_account = local.billing_account - folder_id = google_folder.env_business_unit.name - environment = var.env - project_budget = var.project_budget - project_suffix = var.kms_prj_suffix - project_prefix = local.project_prefix - - activate_apis = ["logging.googleapis.com", "secretmanager.googleapis.com", "cloudkms.googleapis.com"] - - # Metadata - application_name = "${var.business_code}-sample-application" - billing_code = "1234" - primary_contact = "example@example.com" - secondary_contact = "example2@example.com" - business_code = var.business_code -} - data "google_storage_project_service_account" "gcs_account" { project = module.base_shared_vpc_project.project_id } @@ -43,7 +22,7 @@ module "kms" { source = "terraform-google-modules/kms/google" version = "~> 2.1" - project_id = module.env_kms_project.project_id + project_id = local.kms_project_id keyring = var.keyring_name location = var.location_kms keys = [var.key_name] diff --git a/4-projects/modules/base_env/outputs.tf b/4-projects/modules/base_env/outputs.tf index 469ddd7f8..565910d96 100644 --- a/4-projects/modules/base_env/outputs.tf +++ b/4-projects/modules/base_env/outputs.tf @@ -79,11 +79,6 @@ output "peering_complete" { value = module.peering.complete } -output "env_kms_project" { - description = "Project sample for KMS usage project ID." - value = module.env_kms_project.project_id -} - output "keyring" { description = "The name of the keyring." value = module.kms.keyring diff --git a/4-projects/modules/base_env/remote.tf b/4-projects/modules/base_env/remote.tf index c49c9f0b8..36a78f2d7 100644 --- a/4-projects/modules/base_env/remote.tf +++ b/4-projects/modules/base_env/remote.tf @@ -29,6 +29,7 @@ locals { env_folder_name = data.terraform_remote_state.environments_env.outputs.env_folder app_infra_pipeline_service_accounts = data.terraform_remote_state.business_unit_shared.outputs.terraform_service_accounts enable_cloudbuild_deploy = data.terraform_remote_state.business_unit_shared.outputs.enable_cloudbuild_deploy + kms_project_id = data.terraform_remote_state.environments_env.outputs.env_kms_project_id } data "terraform_remote_state" "bootstrap" {