An online retail platform uses Cloud Build to automate continuous deployment of microservices to Google Kubernetes Engine (GKE) clusters across staging and production environments. To maintain strict security and governance, the deployment pipeline must run with the minimum permissions required to impersonate the workload's runtime service account, while ensuring that automated Terraform infrastructure updates prevent concurrent state corruption. Which architecture strategy should the cloud team implement?
- Grant the Cloud Build service account the Service Account User role (roles/iam.serviceAccountUser) on the runtime service account, and configure a Cloud Storage backend with object versioning and state locking for Terraform state management.Cevap
- BGrant the Cloud Build service account the Service Account Admin role (roles/iam.serviceAccountAdmin) across the project, and store Terraform state files in a local directory during pipeline execution.
- CGrant the primitive Owner role to the Cloud Build service account, and maintain Terraform state files in an unversioned Cloud Storage bucket without state locking.
- DGrant the Cloud Build service account the Service Account User role on the runtime service account, and save Terraform state locally within the Cloud Build workspace container.
Cevap
Granting the Service Account User role (roles/iam.serviceAccountUser) on the specific runtime service account to the Cloud Build service account follows least privilege for workload execution. Configuring a remote Cloud Storage backend with state locking and object versioning secures Terraform state against concurrency conflicts and corruption.
The correct strategy enforces the principle of least privilege by granting the Cloud Build service account the Service Account User role specifically on the runtime service account rather than project-wide admin permissions. Concurrently, managing Terraform state using a remote Cloud Storage backend with object versioning and state locking ensures that automated pipeline runs do not suffer from state loss or concurrent execution conflicts.
Adım Adım Çözüm
Anahtar Kavram
Continuous Deployment Pipeline Security and Declarative Infrastructure State Governance
Tahmini Süre:2m 0s