Problem
When performing CLI driven Terraform runs with a remote backend, policy check output is not displayed on the command line.
Cause
- Prior to Terraform 1.4, OPA evaluation output was not present for CLI based runs
Solutions:
-
Upgrade your workspaces to Terraform 1.4+
Outcome
Once your Terraform version is upgraded, you will be able to see OPA policy evaluation outputs under 'post plan tasks':
OPA Policy Evaluation
→→ Overall Result: FAILED
This result means that one or more OPA policies failed. More than likely, this was due to the discovery of violations by the main rule and other sub rules
1 policies evaluated
→ Policy set 1: example-policy-set-opa (1)
↳ Policy name: example-opa-policy
| × Failed
| No description available
Do you want to override the failed policy check?
Only 'override' will be accepted to override.
Enter a value: