Soru

Zorluk: OrtaContinuous Integration and Continuous Delivery (CI/CD) Pipeline Design

An enterprise organization is establishing an automated Continuous Integration and Continuous Delivery (CI/CD) pipeline using Cloud Build to provision and update infrastructure across multiple Google Cloud projects using Terraform. The architecture team requires that concurrent execution of pipeline builds does not result in state file corruption or race conditions. Additionally, access to infrastructure state must adhere to least privilege security practices. Which architecture design meets these requirements?

  1. Configure a Cloud Storage bucket with Object Versioning as the remote Terraform backend, and grant the Cloud Build service account specific predefined Storage Object Admin and resource-specific IAM roles.Cevap
  2. B
    Maintain Terraform state files within the local directory of the ephemeral Cloud Build worker runner filesystem during pipeline execution.
  3. C
    Assign the primitive Owner role (roles/owner) to the Cloud Build service account to ensure it has unrestricted access to lock state and provision all cloud resources.
  4. D
    Grant the Service Account Admin role (roles/iam.serviceAccountAdmin) to the Cloud Build service account to allow it to impersonate runtime service accounts during deployment.

Cevap

Configure a Cloud Storage bucket with Object Versioning as the remote Terraform backend, and grant the Cloud Build service account specific predefined Storage Object Admin and resource-specific IAM roles.
Configuring Cloud Storage as the remote backend provides built-in state locking mechanisms that prevent race conditions during parallel CI/CD pipeline executions. Combining this with specific predefined roles satisfies least privilege security standards.

Adım Adım Çözüm

1
Identify the state management requirement for concurrent execution safety.
Cloud Storage serves as a remote backend supporting automatic state locking and versioning in Google Cloud.
Remote state locking prevents two concurrent Cloud Build runs from modifying the infrastructure state simultaneously.
2
Evaluate IAM permissions for the CI/CD pipeline service account.
Predefined roles tailored to Cloud Storage and infrastructure provisioning ensure least privilege.
Avoid primitive roles (Owner/Editor) and administrative IAM roles when non-administrative user roles suffice.

Anahtar Kavram

Terraform Remote State Management and CI/CD Security Best Practices in Cloud Build
Bu soruyu puanla