A cloud engineering team is preparing to collaborate on provisioning Google Cloud resources using Terraform. To ensure concurrent state locking and prevent state file corruption during team deployments, which remote backend configuration should they use?
- Configure a Google Cloud Storage (GCS) bucket backend with object versioning enabled.Answer
- BStore the state file in a local git repository directory and rely on git merge operations for concurrency.
- CConfigure a Cloud Storage bucket backend and assign the primitive Owner role to the deployment pipeline service account.
- DStore the state file in Cloud Storage while granting developers the Service Account Admin role to access the backend.
Answer
Configure a Google Cloud Storage (GCS) bucket backend with object versioning enabled.
Configuring a Google Cloud Storage bucket backend provides native lock support during plan and apply actions, preventing race conditions. Enabling object versioning ensures state history is maintained for recovery.
Step-by-Step Solution
Key Concept
Terraform Remote State Management with Google Cloud Storage
Estimated Time:1m 0s