Question

Difficulty: EasyAnalyzing Software Development Lifecycle (SDLC) and CI/CD Pipelines

During a technical review of an enterprise CI/CD pipeline, an organization discovers that manual configuration edits made directly in the Google Cloud Console are frequently causing deployment pipeline failures during Terraform runs. Which operational practice should the team integrate into their continuous integration pipeline to detect and analyze configuration drift before applying changes?

  1. Automate execution of infrastructure plan validation checks (such as running terraform plan) within the CI pipeline to compare current real-world state against desired state definitions.Answer
  2. B
    Grant developers the primitive Owner role on the Google Cloud project so they can directly overwrite state discrepancies when pipeline errors occur.
  3. C
    Store the infrastructure state file directly inside the transient CI build runner's local container directory instead of a shared remote backend.
  4. D
    Rely strictly on VPC Service Controls perimeters to prevent developers from making administrative configuration changes to cloud resources.

Answer

Automate execution of infrastructure plan validation checks (such as running terraform plan) within the CI pipeline to compare current real-world state against desired state definitions.
Automating plan validation runs within the CI pipeline enables continuous detection of configuration drift by comparing the actual live cloud infrastructure state against the target definitions declared in version control.

Step-by-Step Solution

1
Analyze the problem scenario
Manual changes in the GCP Console create discrepancies (configuration drift) between actual infrastructure and IaC code definitions, breaking automated CI/CD deployments.
Understanding the root cause of pipeline failures is required to select the correct CI/CD analysis practice.
2
Evaluate IaC pipeline best practices for drift analysis
Executing a dry-run spec check (such as terraform plan) in CI reads actual resource states and compares them to committed code, highlighting drift before execution.
Continuous drift detection ensures visibility into out-of-band changes before pipeline execution.

Key Concept

Configuration Drift Detection in CI/CD Pipelines
Rate this question