How to Use Open Policy Agent (OPA) with Terraform

Jack Roper
ITNEXT
Published in
7 min readApr 2, 2024

--

In this article, we will delve into the Open Policy Agent (OPA), first explaining what ‘policy as code’ is and how to use it with Terraform. We will explain the open policy agent and how it works, policy language Rego, the differences between Sentinel and OPA, OPA Use cases, and some practical examples of how to use it in your Terraform configurations.

Photo by Scott Graham on Unsplash

What is policy as code?

--

--

A blog about DevOps & Cloud Tech. Specializing in Terraform, Kubernetes, Azure & Azure DevOps! ☁️