A financial analytics firm uses Terraform to provision infrastructure across multiple Google Cloud projects. A recent security and operational audit revealed two critical issues: deployment pipelines frequently fail due to concurrent state file collisions when engineers apply changes simultaneously from local environments, and the service accounts executing infrastructure updates hold excessive administrative access across the entire GCP organization. Which two architectural configurations should you implement to resolve these concurrency and security issues in alignment with Google-recommended best practices? (Select TWO.)
- Configure a Cloud Storage (GCS) bucket as the remote backend for Terraform state files with Object Versioning enabled.Cevap
- BStore Terraform state files in a central Git repository committed alongside module source code to track concurrency.
- CAssign the primitive Owner role at the Organization level to the CI/CD pipeline service accounts to ensure provisioning commands never fail on API authorization.
- Bind granular, predefined or custom IAM roles to dedicated service accounts at the target project scope, and grant deployment engineers the Service Account User role.Cevap
Cevap
To establish secure and reliable Infrastructure as Code workflows, configure a Cloud Storage backend with Object Versioning for Terraform state storage and state locking, and enforce least privilege by assigning granular predefined/custom roles to dedicated service accounts scoped to target projects while delegating access via the Service Account User role.
Configuring a Cloud Storage remote backend ensures automated, native state locking and consistency checks during Terraform executions, preventing concurrent state overwrite issues. Enabling Object Versioning adds durability against state corruption. Combining this backend configuration with fine-grained, project-scoped IAM roles and granting developers the Service Account User role ensures that automated infrastructure provisioning adheres strictly to Google Cloud security best practices.
Adım Adım Çözüm
Anahtar Kavram
Terraform Remote State Management and IAM Least Privilege Delegation in Google Cloud