Q: What is the Open Policy Agent (OPA) integration with Terraform?
OPA evaluates Terraform plan JSON against Rego policies. Example: deny any plan that creates a publicly accessible S3 bucket. Used in CI ...
#Terraform #Use VPC ID from another module #L3 #IaC #Cloud Infrastructure #S3
🎙️ Candidate Opening & Architectural Context
""Treat Terraform code with the same rigor as application code: pre-merge plans, state locks, and automated drift detection. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix.""
Advertisement
🛠️ Production Runbook & Step-by-Step Resolution
1️⃣
Production Solution & Architecture
OPA evaluates Terraform plan JSON against Rego policies. Example: deny any plan that creates a publicly accessible S3 bucket. Used in CI to enforce organizational policies before apply. Terraform Cloud has OPA policy sets built-in.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: OPA evaluates Terraform plan JSON against Rego policies. Example: deny any plan that creates a publicly accessible S3 bucket. Used."
⚡ 60-Second Elevator Pitch Talking Points
- Immediate Triage: OPA evaluates Terraform plan JSON against Rego policies. Example: deny any plan that creates a
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Advertisement