Skip to main content
This page is for the MergeWatch SaaS deployment only. If you are self-hosting, you do not need SAM. The self-hosted deployment uses Docker and does not involve AWS Lambda or CloudFormation. See Self-Hosting Install instead.
The MergeWatch SAM template (infra/template.yaml) defines all AWS resources required to run the pipeline. It deploys with a single command:
The project uses a scripts/deploy.sh wrapper around sam build && sam deploy — invoke it with pnpm run deploy:dev / deploy:staging / deploy from the mergewatch.ai repo. You only need to invoke SAM directly if you are customizing deployment flags.

Parameters

The template accepts four parameters that control the deployment:
For self-hosted deployments, set DashboardBaseUrl to your own domain if you are running the dashboard separately, or leave the default if you only use GitHub for viewing results.

Resources created

The template creates the following AWS resources:

Outputs

After deployment, the stack exports these values: You can retrieve outputs at any time with:

IAM permissions

The Lambda execution role follows least-privilege principles. It includes the following permissions:
logs:CreateLogGroup, logs:CreateLogStream, logs:PutLogEventsAllows both Lambda functions to write execution logs to CloudWatch.
dynamodb:GetItem, dynamodb:PutItem, dynamodb:UpdateItem, dynamodb:QueryScoped to the two MergeWatch tables only. No Scan or DeleteItem permissions are granted.
bedrock:InvokeModelScoped to the model ID specified in the DefaultBedrockModelId parameter. The ReviewAgent uses this to call the multi-agent pipeline.
ssm:GetParameterScoped to /mergewatch/{stage}/*. Allows Lambda to decrypt and read GitHub App credentials at runtime.
lambda:InvokeFunctionScoped to the ReviewAgent function ARN. WebhookHandler uses this to invoke ReviewAgent asynchronously (InvocationType.Event).
Do not attach broader permissions (e.g. bedrock:* or dynamodb:*) to the execution role. The template is scoped intentionally — widening permissions increases your blast radius if the role is ever compromised.

Customization

You can override template parameters in two ways:
For the full list of sam deploy options, see the AWS SAM CLI reference.

Next steps

Architecture Overview

Understand how the components connect end-to-end.

Self-Hosted Install

Deploy MergeWatch on your own infrastructure with Docker.