A retail enterprise is provisioning a regional relational database infrastructure on Google Cloud using Terraform. Multiple cloud engineers will execute concurrent deployments, and compliance guidelines require protecting the infrastructure configuration state against state corruption, concurrent executions, and accidental state destruction. Which strategy should be implemented to securely provision and manage the infrastructure state?
- Configure a remote Terraform backend utilizing a Google Cloud Storage bucket with Object Versioning enabled and native backend locking.Answer
- BMaintain the Terraform state file inside the local version control repository alongside application code to maintain deployment history.
- CProvision Cloud Spanner multi-region instances to store and replicate the Terraform state file globally for state management.
- DConfigure the storage backend to encrypt state files using Customer-Supplied Encryption Keys (CSEK) managed manually during deployment pipelines.
Answer
Configure a remote Terraform backend utilizing a Google Cloud Storage bucket with Object Versioning enabled and native backend locking.
Configuring a remote Cloud Storage backend with Object Versioning enabled ensures centralized state management, automated lock acquisition to prevent concurrent state overwrites, and state recovery capabilities.
Step-by-Step Solution
Key Concept
Terraform Remote Backend & State Provisioning Security