Sitemap

Member-only story

How to use OPA Policies with AWS CDK and GitHub Actions.

Infrastructure provisioning with governance

5 min readJun 23, 2025
https://www.openpolicyagent.org/
https://www.openpolicyagent.org/

OPA allows organizations to enforce policies across various systems, including APIs, microservices, Kubernetes, CI/CD pipelines, and infrastructure components.

https://github.com/mercadoalex/aws_cdk_s3_opa

I created a similar exercise using Terraform and Sentinel; you can review it by clicking here and try it out to see if the solution works best for you. I prefer Terraform and Sentinel, as they are easier to use and implement, but this implies, of course, some spending $$$$.

For this exercise, you need the AWS CLI and CDK already installed, a GitHub account to store the project, and to make the workflow.

I´m not going into too much detail about the AWS CDK process and setup. To stay focused on OPA policy validation and integration, here is a starting guide.

--

--

Alex
Alex

Written by Alex

DevOps Lead @evinova, former Dynatrace Solutions Engineer. Cheerleader in Chief for KMMX, Technical Writer & International Speaker, Dad & 2 cats.

No responses yet