https://github.com/mdb/terraform-opa-demo
A simple example showing automated Terraform plan analysis using the Open Policy Agent policy-as-code framework.
https://github.com/mdb/terraform-opa-demo
Last synced: 3 months ago
JSON representation
A simple example showing automated Terraform plan analysis using the Open Policy Agent policy-as-code framework.
- Host: GitHub
- URL: https://github.com/mdb/terraform-opa-demo
- Owner: mdb
- Created: 2021-05-09T18:40:06.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-06T17:04:35.000Z (almost 2 years ago)
- Last Synced: 2025-04-17T16:55:31.476Z (about 1 year ago)
- Language: Makefile
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/mdb/terraform-opa-demo/actions/workflows/main.yml)
# terraform-opa-demo
A relatively simple and largely contrived example showing automated Terraform
plan analysis using the [Open Policy Agent](https://www.openpolicyagent.org/)
policy-as-code framework.
## Usage
`terraform-opa-demo` assumes you're running [Docker](https://www.docker.com/).
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
```