Question

Difficulty: MediumProvisioning Storage and Database Systems

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?

  1. Configure a remote Terraform backend utilizing a Google Cloud Storage bucket with Object Versioning enabled and native backend locking.Answer
  2. B
    Maintain the Terraform state file inside the local version control repository alongside application code to maintain deployment history.
  3. C
    Provision Cloud Spanner multi-region instances to store and replicate the Terraform state file globally for state management.
  4. D
    Configure 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

1
Identify the state management requirements for Infrastructure as Code provisioning.
Requirements include support for team collaboration, prevention of concurrent state operations, and resilience against state corruption.
Enterprise IaC deployments require remote centralized state backends to prevent race conditions.
2
Evaluate Google Cloud Storage capabilities for Terraform backends.
Cloud Storage supports native lock acquisition and Object Versioning.
Object Versioning enables rollback to historical state versions if accidental state corruption occurs, while native locking prevents concurrent modifications.

Key Concept

Terraform Remote Backend & State Provisioning Security
Rate this question