A relatively simple and largely contrived example showing automated Terraform plan analysis using the Open Policy Agent policy-as-code framework.
terraform-opa-demo
assumes you're running Docker.
Execute a terraform plan
(see the Makefile
for details):
make tf-plan
Run tests verifying the correctness of the policy.rego
file and evaluate the
Terraform plan JSON using the expressed policy (see the Makefile
for details):
make opa-eval