Skip to content

Commit

Permalink
remove extraneous module.env_kms_project and its outputs, these shoul…
Browse files Browse the repository at this point in the history
…d not be used. replace references to it with module.env_kms configured in Stage 2.
  • Loading branch information
eeaton committed Jun 21, 2024
1 parent 1b7d933 commit d931d6f
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 42 deletions.
5 changes: 0 additions & 5 deletions 4-projects/business_unit_1/development/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions 4-projects/business_unit_1/nonproduction/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions 4-projects/business_unit_1/production/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 1 addition & 22 deletions 4-projects/modules/base_env/example_storage_cmek.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]"
secondary_contact = "[email protected]"
business_code = var.business_code
}

data "google_storage_project_service_account" "gcs_account" {
project = module.base_shared_vpc_project.project_id
}
Expand All @@ -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]
Expand Down
5 changes: 0 additions & 5 deletions 4-projects/modules/base_env/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions 4-projects/modules/base_env/remote.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit d931d6f

Please sign in to comment.