A development team is establishing an automated Infrastructure as Code (IaC) deployment pipeline using Terraform on Google Cloud. As a Cloud Architect, you are advising the operations team on foundational security and state management best practices. Which TWO recommendations should you provide to ensure secure, concurrent, and reliable deployments? (Select TWO answers.)
- Store the Terraform state file in a Google Cloud Storage backend with object versioning and state locking enabled.Answer
- Grant CI/CD service accounts fine-grained predefined or custom IAM roles adhering to the principle of least privilege.Answer
- CStore Terraform state files on the local filesystem of developer workstations or CI runners to maximize execution speed.
- DAssign the primitive Owner role to the deployment service account to ensure pipeline tasks never fail due to missing permissions.
- EGrant the Service Account Admin role to developers who need to run infrastructure deployment scripts from their local machines.
Answer
The architect should advise the team to store Terraform state in a Cloud Storage bucket with object versioning and state locking enabled, and to grant deployment service accounts least-privilege predefined or custom IAM roles.
Centralizing Terraform state management using a Google Cloud Storage bucket with versioning and object locking ensures multi-user concurrency protection and disaster recovery for IaC state. Concurrently, granting specific predefined or custom roles to deployment service accounts enforces the principle of least privilege without exposing administrative control over unrelated resources.
Step-by-Step Solution
Key Concept
Advising operations and development teams on Cloud Storage Terraform backends and least-privilege IAM service account configuration.