A financial analytics firm provisions its multi-environment Google Cloud infrastructure using Terraform executed via Cloud Build CI/CD pipelines. The lead cloud architect must establish a centralized Infrastructure as Code (IaC) governance model that prevents concurrent state updates, protects state file integrity, and adheres to the principle of least privilege. Which strategy should the architect implement?
- Configure a remote Terraform backend using a Cloud Storage bucket with Object Versioning enabled, and execute Cloud Build pipelines using a dedicated service account granted fine-grained, predefined IAM roles.Answer
- BStore state files directly within the source control repository using encrypted local backends, allowing Cloud Build triggers to commit updated state files after each deployment run.
- CConfigure a remote Cloud Storage backend for state storage, and grant the Cloud Build service account the primitive Editor role across all targeted Google Cloud projects to streamline provisioning.
- DConfigure a remote Cloud Storage backend for Terraform state, but instruct operations engineers to make urgent infrastructure changes directly via the Google Cloud Console during system outages.
Answer
Configure a remote Terraform backend using a Cloud Storage bucket with Object Versioning enabled, and execute Cloud Build pipelines using a dedicated service account granted fine-grained, predefined IAM roles.
The correct solution configures a Cloud Storage remote backend with Object Versioning enabled to provide distributed state locking and state historical backup. Combining this backend with a dedicated Cloud Build service account assigned fine-grained predefined IAM roles follows Google Cloud recommended architectural practices for secure, scalable Infrastructure as Code deployment.
Step-by-Step Solution
Key Concept
Terraform Remote Backend & IAM Least Privilege Governance
Estimated Time:1m 30s