A DevOps engineering team is setting up an Infrastructure as Code workflow using Terraform to provision Google Cloud storage buckets and database instances. They need to configure a remote backend that supports automatic state locking and prevents state corruption during concurrent deployments by multiple engineers. Which storage configuration should they implement?
- Configure a Google Cloud Storage (GCS) backend with Object Versioning enabled for storing the state file.Cevap
- BStore the Terraform state file in a local git repository committed alongside the code modules.
- CEncrypt state files using Customer-Supplied Encryption Keys (CSEK) and upload them manually to a local shared drive after each execution.
- DProvision a multi-region Cloud Spanner instance to store the state table data manually.
Cevap
Configure a Google Cloud Storage (GCS) backend with Object Versioning enabled for storing the state file.
Configuring a Google Cloud Storage (GCS) backend with Object Versioning enabled is the standard best practice for managing Terraform state in GCP environments. GCS natively supports state locking via Cloud Storage API lock mechanisms, preventing concurrent modifications and protecting state integrity.
Adım Adım Çözüm
Anahtar Kavram
Terraform Remote Backend Provisioning on Google Cloud Storage