Using OPA to check the Terraform configuration
In the previous recipes, we learned how to apply a Terraform compliance check using several tools and languages, such as PowerShell’s Pester.
Now, in this recipe, we will study another popular tool, called Open Policy Agent (OPA), which allows us to perform checks on Terraform configuration.
Before we start, here is a short introduction to OPA.
OPA is an open source, general-purpose policy engine that provides a unified language for managing policies across an organization’s software infrastructure. OPA is designed to help organizations define, manage, and enforce policies consistently across different applications, services, and infrastructure.
OPA allows developers and operators to write policies in a declarative language called Rego. Rego is a high-level language that is designed to be easy to read and write, making it accessible to non-experts in policy management. Rego policies can be written to enforce...