Outcomes
- 160 AWS workflow planning routes and every GitHub repository stack go through the broker.
- 316 unit tests, plus 9 disposable PRs that prove both the allowed and the denied paths.
The problem
Standard Terraform and OpenTofu plan-on-PR workflows give the PR branch read access to remote state, broad cloud roles or GitHub App keys.
The team wanted plan previews on every IaC change without that exposure.
What I built
- A publisher that runs after each reviewed apply on the main branch. It checks the exact state object version, size and SHA-256, then writes an immutable, content-addressed snapshot and a receipt. It fails closed.
- A broker on Lambda that serves PR workflows only from those reviewed snapshots.
- PR jobs that check out trusted base code apart from the candidate change, validate inputs before any credential exists, and plan in an offline container on a RAM disk.
- Only bounded plan results leave the job. Raw state and credentials never do.
- A rollout across every GitHub repository stack and AWS stack, with automated coverage checks.
Architecture and stack
- AWS Lambda (Node.js), S3 versioned snapshots and conditional writes, IAM and OIDC
- OpenTofu
- Docker (network disabled)
- Python, GitHub Actions reusable workflows