An enterprise logistics company is transitioning its Google Cloud infrastructure automation to HashiCorp Terraform. To support collaborative deployment pipelines across multiple engineering teams, the lead architect must establish a centralized state management architecture that prevents concurrent state modification conflicts and enables recovery if state files are corrupted or accidentally deleted. Which strategy satisfies these operational requirements following Google-recommended best practices?
- Configure a Terraform Google Cloud Storage remote backend referencing a dedicated GCS bucket with Object Versioning enabled.Answer
- BStore state files within local version control repositories shared among developers to handle concurrent updates through Git merge operations.
- CAssign the primitive Owner role to all automated CI/CD service accounts to bypass state file locking checks during parallel pipeline executions.
- DRequest a regional Compute Engine API quota increase prior to each deployment pipeline run to resolve state lock timeout errors.
Answer
Configure a Terraform Google Cloud Storage remote backend referencing a dedicated GCS bucket with Object Versioning enabled.
Configuring the standard `gcs` remote backend in Terraform allows teams to store state in Google Cloud Storage. The GCS backend natively supports state locking using Cloud Storage strong consistency and object generation preconditions, preventing concurrent operations from corrupting state. Enabling Object Versioning on the bucket ensures historical state file versions are retained for point-in-time recovery.
Step-by-Step Solution
Key Concept
Terraform Remote Backend with Google Cloud Storage and State Locking
Estimated Time:1m 30s