An organization is provisioning infrastructure for a standard regional e-commerce application operating in a single Google Cloud region. The solution requires a relational database system optimized for cost and single-region transactional performance without global distribution overhead. Additionally, the DevOps team must provision a shared remote backend for Infrastructure as Code (Terraform) state management that prevents concurrent state modifications, protects against accidental deletion/corruption through state recovery, and adheres to key management governance using Cloud KMS. Which architectural provisioning strategy meets these requirements?
- Provision a Cloud SQL instance for the database workload, and store the Terraform state in a Cloud Storage bucket configured with object versioning and Customer-Managed Encryption Keys (CMEK) via Cloud KMS.Answer
- BProvision a multi-region Cloud Spanner instance for the database workload, and store the Terraform state in a regional Cloud Storage bucket without object versioning.
- CProvision a Cloud SQL instance for the database workload, and maintain the Terraform state file on a local persistent disk attached to a centralized deployment virtual machine.
- DProvision a Cloud SQL instance for the database workload, and configure a Cloud Storage bucket using Customer-Supplied Encryption Keys (CSEK) provided via raw key strings for the remote state backend.
Answer
Provision a Cloud SQL instance for the database workload, and store the Terraform state in a Cloud Storage bucket configured with object versioning and Customer-Managed Encryption Keys (CMEK) via Cloud KMS.
The correct strategy provisions Cloud SQL, which accurately fits the single-region relational requirement without incurring unnecessary Cloud Spanner overhead. Storing the Terraform remote state in Cloud Storage with object versioning enabled ensures state backup recovery, native backend state locking, and encryption governed by Cloud KMS (CMEK).
Step-by-Step Solution
Key Concept
Provisioning Cloud SQL and configuring secure Cloud Storage remote state backends with CMEK and versioning for Terraform.