RepliMap Docs

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-high to fail only on HIGH or CRITICAL drift.
  • Use --managed-only to ignore resources that are not in the state.
  • Use --ignore-file .replimap-ignore.yml to 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.

ToolPlan
replimap_scan, replimap_graph, replimap_residencyFree
replimap_auditFindings are free; the report file is Pro+
replimap_codifyResource files are free; import blocks for the whole account need Pro+ (use replimap codify --vpc for one VPC, free)
replimap_depsPro+. 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-readonly

For other clients, run the same command as a stdio server: uvx --from 'replimap[mcp]' python -m replimap.mcp_server --workspace DIR [--profile NAME].

  • --workspace is required. Every file a tool reads or writes must stay inside it.
  • --profile is 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.

On this page