CI and AI agents
Run a weekly drift check in CI and connect RepliMap to a coding agent over MCP
Scheduled drift checks in CI
After a takeover, the next risk is console changes creeping back. replimap drift
compares your Terraform state with the live account. It reports changed and deleted
resources, and resources that exist only in AWS. With --fail-on-drift, any finding
fails the job. Drift is free on every plan.
This GitHub Actions example runs weekly with a read-only role assumed through OIDC, so no keys are stored:
# .github/workflows/replimap-drift.yml
name: replimap drift
on:
schedule: [{ cron: "0 20 * * 0" }] # weekly
workflow_dispatch:
permissions:
id-token: write # OIDC
contents: read
jobs:
drift:
runs-on: ubuntu-latest
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::<ACCOUNT_ID>:role/replimap-readonly # see the IAM policy page
aws-region: us-east-1
- uses: actions/setup-python@v5
with: { python-version: "3.12" }
- run: pip install replimap
- run: |
replimap drift -r us-east-1 \
--state-bucket my-tfstate-bucket --state-key prod/terraform.tfstate \
--fail-on-drift --no-open -f json -o drift.json
- if: always()
uses: actions/upload-artifact@v4
with: { name: drift-report, path: drift.json }- Use
--fail-on-highto fail only on HIGH or CRITICAL drift. - Use
--managed-onlyto ignore resources that are not in the state. - Use
--ignore-file .replimap-ignore.ymlto exempt known differences.
The same commands work in GitLab CI, Bitbucket Pipelines or cron. The runner needs read access to AWS and to the state bucket. Nothing is sent to RepliMap. For the role's permissions, see the IAM policy.
AI agents (MCP server, experimental)
RepliMap ships an MCP server. A coding agent (Claude Code, Cursor and others) can
then look at the real account before it edits Terraform. For example, it can read
the dependency graph (replimap_graph) to see what a security group is attached to.
| Tool | Plan |
|---|---|
replimap_scan, replimap_graph, replimap_residency | Free |
replimap_audit | Findings are free; the report file is Pro+ |
replimap_codify | Resource files are free; import blocks for the whole account need Pro+ (use replimap codify --vpc for one VPC, free) |
replimap_deps | Pro+. Gives the impact of changing one resource, like replimap deps |
Tools reuse the local scan cache when one exists.
# Claude Code
claude mcp add replimap -- \
uvx --from 'replimap[mcp]' python -m replimap.mcp_server \
--workspace /path/to/your/terraform-repo --profile prod-readonlyFor other clients, run the same command as a stdio server:
uvx --from 'replimap[mcp]' python -m replimap.mcp_server --workspace DIR [--profile NAME].
--workspaceis required. Every file a tool reads or writes must stay inside it.--profileis fixed when the server starts, so the agent cannot switch accounts.- Scan results include tag values that anyone with write access to the account can set. Treat them as untrusted input to the agent.
The tool set and arguments may change between releases. The CLI plan tiers also apply through the Python API and the MCP server.