Code Reviewer using Kiro on AWS Lambda MicroVMs

AWS CodeCommit → AWS Lambda MicroVMs

Deploy AWS Lambda MicroVMs that run Kiro headless to perform AI-powered code reviews on AWS CodeCommit pull requests.

This pattern deploys long-running Lambda MicroVMs with the Kiro CLI installed. The MicroVMs expose an HTTP API (port 8080) that accepts code review requests specifying a CodeCommit repository and pull request ID.
When a review is triggered, the service clones the repository, computes the diff between the source and destination commits, and invokes Kiro headless to generate a structured code review covering security, bugs, performance, and code quality.
The Kiro API Key is stored in AWS Secrets Manager and fetched at runtime. The review output is posted back as a comment on the CodeCommit pull request. The MicroVM auto-suspends when idle and resumes on demand with sub-second latency.
The CloudFormation stack also provisions a sample CodeCommit repository seeded with a deliberately vulnerable 'feature branch' PR, so you can test the reviewer immediately after deployment.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/lambda-microvms-kiro-code-reviewer

Deploy

export KIRO_API_KEY="your-kiro-api-key"export KIRO_API_KEY="your-kiro-api-key-here"export STACK_NAME="your-stack-name-here"export REGION="you-region-here"chmod +x scripts/deploy.sh./scripts/deploy.sh [stack-name] [region]


Testing

See the README for the full curl command to trigger a review on the sample PR.

Cleanup

aws cloudformation delete-stack --stack-name kiro-reviewer --region us-east-2

Created by:

Ricardo Marques

Ricardo Marques

Sr Serverless Specialist, AWS

Follow on LinkedIn