Soru

Zorluk: KolayProvisioning Storage and Database Systems

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?

  1. Configure a Google Cloud Storage (GCS) backend with Object Versioning enabled for storing the state file.Cevap
  2. B
    Store the Terraform state file in a local git repository committed alongside the code modules.
  3. C
    Encrypt state files using Customer-Supplied Encryption Keys (CSEK) and upload them manually to a local shared drive after each execution.
  4. D
    Provision 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

1
Identify the state locking and concurrency requirement for Terraform provisioning on GCP.
Recognize that team collaboration requires a remote backend with automatic locking mechanisms.
Local state files do not lock state when multiple operators attempt concurrent provisioning.
2
Select the native Google Cloud storage service designed for Terraform state management.
Choose Google Cloud Storage (GCS) bucket configured as the backend.
GCS integrates directly with Terraform to provide automatic object locking and durability.
3
Apply object versioning on the GCS bucket.
Ensure past versions of state files can be restored if a state corruption event occurs.
Object Versioning adds an extra layer of recovery for critical infrastructure state files.

Anahtar Kavram

Terraform Remote Backend Provisioning on Google Cloud Storage
Bu soruyu puanla