An enterprise platform engineering team is designing an automated continuous integration and continuous deployment (CI/CD) framework to provision Google Cloud infrastructure across multiple target projects using Terraform. The security architecture requires that pipeline runners execute without static service account keys, state management prevents concurrent runs and state corruption, and deployments follow the principle of least privilege. Which architectural implementation best meets these requirements?
- Configure a centralized Google Cloud Storage bucket with object versioning enabled for the Terraform backend, and authenticate pipeline runners using Workload Identity Federation to impersonate a service account assigned fine-grained predefined or custom IAM roles on target resources.Cevap
- BStore Terraform state files in a shared local repository directory synchronized across pipeline build nodes, and assign the primitive Owner role to the deployment service account to ensure all infrastructure provisioning operations succeed without credential failure.
- CConfigure a Google Cloud Storage bucket for Terraform state management, export a long-lived service account JSON key into CI/CD secrets variables, and grant the service account the primitive Editor role across all managed target projects.
- DConfigure a Google Cloud Storage bucket for Terraform remote state, and grant the Service Account Admin role directly to pipeline execution users so they can dynamically generate and rotate credentials during each plan and apply workflow.
Cevap
Configure a centralized Google Cloud Storage bucket with object versioning enabled for the Terraform backend, and authenticate pipeline runners using Workload Identity Federation to impersonate a service account assigned fine-grained predefined or custom IAM roles on target resources.
The solution leveraging a Cloud Storage bucket with object versioning alongside Workload Identity Federation provides native state locking, protection against accidental state deletion, zero static key management overhead, and adherence to least-privilege IAM controls.
Adım Adım Çözüm
Anahtar Kavram
Terraform Remote Backend & Workload Identity Federation Governance