A media streaming organization provisions its Google Cloud infrastructure using Terraform. During an operational review, the DevOps team discovers that engineers manually modified VPC firewall rules and Cloud Storage bucket access controls directly via the Google Cloud Console to address emergency hotfixes. Consequently, subsequent automated Terraform deployment pipelines are failing due to configuration drift. Which strategy should a cloud architect implement to safely resolve the configuration drift and prevent future unauthorized manual modifications?
- Reconcile the configuration drift using terraform plan and refresh, update code or state to reflect approved states, and revoke direct compute write permissions from developers while routing all changes through automated CI/CD pipelines.Answer
- BInstruct developers to continue making emergency manual modifications in the Console and append the -lock=false flag to pipeline deployment scripts to prevent state locking errors.
- CDelete the remote Terraform state file stored in Cloud Storage and re-initialize fresh state files on local developer workstations to match current infrastructure settings.
- DGrant the primitive Owner role to all developer IAM user accounts so manual Console changes automatically update the remote state file without triggering pipeline errors.
Answer
Reconcile configuration drift using terraform plan and refresh, update the Terraform code to align with authorized infrastructure changes, and enforce automated CI/CD execution while revoking direct manual write access.
Reconciling drift by executing plan operations, updating configuration files to match legitimate changes, and restricting interactive manual write privileges via IAM enforces strict Infrastructure as Code governance and ensures all cloud resource changes remain repeatable and version-controlled.
Step-by-Step Solution
Key Concept
IaC Drift Detection, State Reconciliation, and Governance