Library / Code, Git & Developer Tools
Code, Git & Developer Tools
Review Terraform pull requests with GitHub, GPT-4.1, Postgres and Slack
When something happens in a connected app, it automates developer work with OpenAI / ChatGPT using GitHub, Postgres, Slack.
What it does
## AI Terraform PR Review & Security Agent ### How it works 1. A GitHub pull request touching Terraform files triggers the workflow. 2. An AI agent decides which checks to run — a plan diff, a security scan, a cost estimate, and a search of internal IaC standards. 3. It writes a structured review with a pass/fail verdict per category and an overall risk rating. 4. The review is posted back to the PR as a comment and logged to Postgres for audit history. 5. Clean reviews auto-approve the PR; anything flagged high-risk routes to a human via Slack before it can merge. ### Setup - [ ] Add GitHub credentials (repo scope, PR write access) on the trigger and all GitHub nodes - [ ] Add an OpenAI credential and a Vector Store credential for the RAG tool - [ ] Wire Tool - Run Terraform Plan and Tool - Run Security Scan to your CI runner — never let the agent apply, only plan/scan - [ ] Wire Tool - Estimate Cost Impact to Infracost's API or CLI output - [ ] Add a Postgres credential and create the terraform_pr_reviews table - [ ] Add Slack credentials on the security-review notification node - [ ] Point Wait - For Security Sign-Off's resume webhook at your reviewer UI's approve/request-changes action ### Customization Open a test PR touching a .tf file to run end-to-end, then push again to the same PR to confirm the sessionId keeps review context across revisions.
The steps
- GitHub Trigger - PR Opened/Updated
- Set - Config
- Get - PR Diff
- Tool - Run Terraform Plan
- Tool - Run Security Scan
- Tool - Estimate Cost Impact
- Tool - RAG Search IaC Standards
- OpenAI Chat Model
- Window Buffer Memory
- AI Agent - Terraform Reviewer
- Set - Parse Agent Output
- Postgres - Log PR Review
- GitHub - Post Review Comment
- IF - Review Passed
20 steps in total.
Similar automations
Code, Git & Developer ToolsTriage DevOps incidents from Slack with GPT-4.1, Prometheus, Jira and Terraform23 stepsCode, Git & Developer ToolsReview GitHub Pull Requests with OpenAI8 stepsCode, Git & Developer ToolsReview GitHub Pull Requests with OpenAI, Log to Sheets20 stepsCode, Git & Developer ToolsReview GitHub Pull Requests for Code Quality with Gemini20 steps