Fix/aw bootstrap hierarchy cmek - #220
Open
lynn-goog wants to merge 3 commits into
Open
Conversation
… constraint naming, and service agents - modules/folder: Filter for CONSUMER_FOLDER in Assured Workloads resources to prevent resolving the encryption keys project as the parent folder ID. - modules/organization-se: Strip hyphens from org policy custom constraint names and policy names using replace(var.prefix, "-", "") to adhere to GCP alphanumeric constraint naming requirement. - modules/project: Add cloudkms to disabled default service agent bindings and remove obsolete bq_sa data source that triggered 403 Access Denied on new projects.
… logging buckets, and KMS IAM bindings - organization.tf, budgets.tf, outputs.tf: Centralize Assured Workloads consumer folder resolution into local.assured_workload_folder, filtering by CONSUMER_FOLDER to prevent using encryption keys project ID as parent folder. - log-export.tf: Use coalesce(var.logging_kms_key, module.logging-kms.key_ids["log-sink"]) to correctly pass CMEK key IDs to logging buckets and sinks, add module.logging-kms to depends_on, and explicitly enable logging.googleapis.com on the audit logs project. - kms.tf: Make KMS IAM bindings conditional on contains(local.log_types, ...) to avoid creating bindings for unconfigured sink types, and grant roles/cloudkms.cryptoKeyEncrypterDecrypter to the Cloud Logging service agent on the log-sink crypto key.
…n, and constraint naming
- modules/folder/main.tf: Wrap format inside try() to prevent unhandled fatal error when one() returns null for non-existent CONSUMER_FOLDER.
- fast/stages-aw/0-bootstrap/kms.tf: Remove duplicate logging IAM binding from KeyRing level, preserving least-privilege key-level binding under keys["log-sink"].
- fast/stages-aw/0-bootstrap/log-export.tf: Add depends_on = [module.logging-kms] to log-export-dataset, log-export-gcs, and log-export-pubsub to eliminate race conditions before KMS IAM bindings propagate.
- modules/organization-se: Use regex replace /[^a-zA-Z0-9]/ and startswith("custom.") to ensure custom constraints conform strictly to GCP naming rules.
Collaborator
|
After pushing some minor changes I went ahead and validated this branch ( Summary of Fixes and Verification Results
Plan Output (
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
Fixes # (GitHub issue id)
Type of Change
Deployment & Compliance Impact
Checklist
Code Quality & Reusability
modules/orfast/can be leveraged for this change.documentation/naming-convention.md.Documentation
README.mdof the modified module or blueprint.Security
Testing
Testing Performed
Please describe the tests that you ran to verify your changes.
All syntax, type constraints, and relationships have been fully verified with terraform validate and live GCP API calls.