A financial technology company is automating the infrastructure deployment of a regional order-processing database using Terraform. The database requires standard relational ACID capabilities within a single Google Cloud region, automated high-availability failover, and data encryption at rest managed through Cloud KMS. Furthermore, the engineering team must ensure that automated CI/CD execution of Terraform code prevents state corruption and concurrent execution locks when provisioning database and storage resources. Which configuration strategy should the cloud architect recommend?
- Provision a Cloud SQL instance with High Availability (regional failover) encrypted with Customer-Managed Encryption Keys (CMEK), and store the Terraform state in a Cloud Storage backend with object versioning and state locking enabled.Answer
- BProvision a multi-region Cloud Spanner instance encrypted with Customer-Managed Encryption Keys (CMEK), and store the Terraform state file in a shared local directory on the CI/CD build runner.
- CProvision a Cloud SQL instance with High Availability enabled using Customer-Supplied Encryption Keys (CSEK), and configure a Cloud Storage bucket backend for Terraform state.
- DProvision a Cloud SQL instance with High Availability enabled using Customer-Managed Encryption Keys (CMEK), and store the Terraform state file in an unversioned Google Cloud Storage bucket without state locking.
Answer
Provision a Cloud SQL instance configured for High Availability using Customer-Managed Encryption Keys (CMEK) via Cloud KMS, while managing Terraform state in a Cloud Storage backend configured with object versioning and state locking.
Cloud SQL satisfies the requirement for a single-region relational database with automated HA failover, fully supporting CMEK via Cloud KMS integration. Using Google Cloud Storage as a remote Terraform backend with state locking and object versioning ensures secure, concurrent-safe deployment operations.
Step-by-Step Solution
Key Concept
Provisioning Cloud SQL with CMEK and securing IaC state management via Cloud Storage backends.