What do you keep as evidence for an auditor that policy was enforced on every production change?
IntermediateScenarioSecrets Provisioners and Policy as Code
Answer
Situation read → Compliance wants proof, not promises.
What I'd do →
- Retain plan JSON, policy results, approver identity and the commit SHA for each apply.
- Store them in an immutable bucket or HCP Terraform run history.
- Link to CloudTrail events from the apply role.
Why → Plan, policy and approval together tell the full story of a change.
Interview tip → Plan files contain secrets, so encrypt and restrict access.
More on Secrets Provisioners and Policy as Code
A developer hardcodes a DB password in `terraform.tfvars` and commits it. What do you do right now, and what's the long-term fix?BeginnerHow do you avoid Terraform persisting a secret in state when creating a secret in AWS Secrets Manager?AdvancedSomeone wants a `remote-exec` provisioner to configure servers after creation. What's your advice?BeginnerYou must run a one-off command after a resource is created, such as registering with an external system.IntermediateHow do you generate and manage the master password for a new RDS instance?IntermediateCompare Sentinel, OPA/Conftest and Checkov for policy as code.Intermediate