An enterprise architecture team is automating the provisioning of managed relational database instances and object storage buckets using Infrastructure as Code (Terraform) within a multi-developer CI/CD pipeline. Corporate governance policies dictate that all storage and database assets must utilize key management controls where keys can be revoked or rotated within Google Cloud without requiring raw cryptographic keys to be handled or transmitted by developers. Additionally, the execution pipeline must prevent state file corruption during simultaneous deployments and safeguard infrastructure history against accidental deletions. Which TWO actions should the team implement in their provisioning configuration? (Select TWO.)
- Configure a Cloud Storage remote backend for Terraform with object versioning enabled and native state locking to ensure state integrity across automated runs.Cevap
- Grant resource service accounts the Cloud KMS CryptoKey Encrypter/Decrypter role and pass the Customer-Managed Encryption Key (CMEK) resource IDs into the Terraform resource configurations.Cevap
- CSupply raw 256-bit Customer-Supplied Encryption Keys (CSEK) as sensitive input variables in the Terraform module parameters to fulfill key governance without relying on Cloud KMS.
- DStore the Terraform state file in an unversioned local directory within the build container workspace to minimize API call latency during plan and apply steps.
Cevap
The team should configure a Cloud Storage remote backend with object versioning and state locking for Terraform, and grant service accounts the Cloud KMS CryptoKey Encrypter/Decrypter role while specifying CMEK resource IDs in the resource definitions.
Configuring a Cloud Storage remote backend with state locking and object versioning ensures concurrent CI/CD pipeline runs cannot corrupt the Terraform state file, while enabling recovery of previous state versions. Using Customer-Managed Encryption Keys (CMEK) via Cloud KMS fulfills key governance requirements by enabling key lifecycle management and revocation within GCP without requiring developers to manage raw cryptographic key bytes.
Adım Adım Çözüm
Anahtar Kavram
Terraform State Management and CMEK Integration for Provisioned Infrastructure