How did you enforce policies on infrastructure code?
AdvancedBehavioralInfrastructure as Code & Terraform state
Answer
Good answer looks like → "Checkov in CI for common misconfigurations, plus custom OPA Rego policies evaluated against terraform show -json plan output with Conftest, for rules like 'every resource has the owner tag' and 'no security group allows 0.0.0.0/0 on port 22'. Org-level SCPs were the final backstop for things like disabling CloudTrail."
Follow-ups to expect → Why evaluate the plan rather than the code? How did you handle exceptions?
Red flags → Policies written down in a wiki with no enforcement.
More on Infrastructure as Code & Terraform state
What did your Terraform state setup look like?IntermediateHow did you structure your Terraform code?BeginnerWhy did you use folders per environment rather than Terraform workspaces (or vice versa)?IntermediateHow did different Terraform stacks share information?IntermediateDid you ever have a state lock or corrupted state? What did you do?AdvancedHow did you handle Terraform drift?Intermediate