A logistics enterprise is deploying an automated deployment pipeline to provision a database for order management limited to a single GCP region. The application requires ACID transactional consistency to handle localized regional traffic, a strict RPO of zero across two zones, and compliance mandates requiring storage encryption keys to be managed directly within Cloud KMS. Furthermore, the infrastructure operations team must manage the deployment declaratively using Terraform without risking local state file corruption or concurrent state writes. Which configuration approach fulfills these database provisioning and infrastructure management requirements?
- Provision a Cloud SQL for PostgreSQL High Availability instance configured with Customer-Managed Encryption Keys (CMEK) via Cloud KMS, and configure the Terraform remote backend to store state in a Cloud Storage bucket with object versioning and state locking enabled.Answer
- BProvision a multi-region Cloud Spanner instance configured with Customer-Managed Encryption Keys (CMEK) via Cloud KMS, and configure the Terraform remote backend to store state in a Cloud Storage bucket with object versioning and state locking enabled.
- CProvision a Cloud SQL for PostgreSQL High Availability instance configured with Customer-Supplied Encryption Keys (CSEK) passed directly in API calls, and configure the Terraform remote backend to store state in a Cloud Storage bucket with object versioning and state locking enabled.
- DProvision a Cloud SQL for PostgreSQL High Availability instance configured with Customer-Managed Encryption Keys (CMEK) via Cloud KMS, and track the local terraform.tfstate file directly within a private Git repository for automated pipeline execution.
Answer
Provision a Cloud SQL for PostgreSQL High Availability instance configured with Customer-Managed Encryption Keys (CMEK) via Cloud KMS, and store Terraform state in a Cloud Storage backend with object versioning and locking enabled.
Provisioning Cloud SQL for PostgreSQL in a High Availability configuration satisfies single-region relational storage requirements with zonal redundancy. Utilizing Customer-Managed Encryption Keys (CMEK) satisfies the requirement to leverage Cloud KMS for key management. Using a Cloud Storage bucket with object versioning and state locking for the Terraform backend ensures state security, consistency, and protection against concurrent execution conflicts.
Step-by-Step Solution
Key Concept
Provisioning Cloud Database Infrastructure with CMEK and IaC Remote State Locking