Prompt
How do I prevent manual console changes from causing config drift?
Latest observation
To prevent manual console changes from causing config drift, the key idea is: make the console the source of truth only for exploration, not for long-lived configuration.
Here are the most effective patterns:
1) Manage config as code
Use Infrastructure as Code (Terraform, CloudFormation, Pulumi, etc.) or a central config repo so changes are:
- reviewed
- versioned
- reproducible
- auditable
Avoid “clickops” for anything important.
2) Lock down direct edits
Restrict who can make manual changes in the console:
- least-privilege IAM / RBAC
- separate break-glass accounts
- approval workflows for production
- disable or tightly control write access
3) Detect drift automatically
Set up drift detection so changes are caught quickly:
- Terraform drift detection /
planin CI - AWS Config / Azure Policy / GCP Config Controller
- scheduled reconciliation jobs
- alerts when live state differs from desired state
4) Reconcile continuously
Use a GitOps-style workflow:
- desired state lives in git
- CI/CD applies changes
- periodic reconciliation resets out-of-band changes
- console changes are overwritten by the pipeline
5) Make manual changes temporary by policy
If manual changes are occasionally needed:
- require a ticket / incident reference
- time-box them
- record them in a change log
- merge the change back into code immediately afterward
6) Use guardrails
Prevent drift-prone edits with policy controls:
- policy-as-code (OPA/Gatekeeper, Azure Policy, AWS SCPs)
- deny changes outside approved paths
- enforce tags, regions, instance sizes, network rules, etc.
7) Observe and alert on console activity
Enable audit logging:
- AWS CloudTrail
- Azure Activity Log
- GCP Audit Logs
Then alert on:
- console-based changes
- changes outside deployment windows
- sensitive resource modifications
8) Separate mutable and immutable resources
Where possible, use immutable deployment patterns:
- replace instances instead of editing them
- redeploy environments from code
- treat runtime changes as disposable
Practical rule of thumb
If a setting matters enough to cause outages or compliance issues, it should be:
- defined in code
- deployed by automation
- monitored for drift
- protected by policy
If you want, I can also give you:
- a Terraform-specific anti-drift setup
- a cloud-agnostic checklist
- or a GitOps workflow example.