RepliMap Docs

CLI Reference

Complete guide to RepliMap commands

RepliMap ships 23 top-level commands, grouped the same way replimap --help groups them:

This page covers common usage and the flags most people reach for. Every command also has full --help output — pass -h for the complete flag list.

Global Options

These options work with all commands:

OptionShortDescription
--profile-pAWS profile name from ~/.aws/credentials
--region-rAWS region (e.g., us-east-1)
--format-fOutput format: text, json, table
--verbose-vIncrease verbosity (-v, -vv)
--quiet-qSuppress output (errors only)
--version-VShow version info
--privacyShow privacy and data-handling info
--help-hShow help for command

Core Commands

scan

Scans AWS resources and builds the dependency graph.

replimap scan --profile prod --region us-east-1

Options

OptionDescription
--scopeLimit to VPC: vpc:vpc-12345678 or vpc-name:Production*
--entryStart from entry point: alb:my-alb or tag:App=MyApp
--tagFilter by tag: Environment=Production
--typesFilter by resource types, comma-separated. Accepts service aliases (rds, ec2, s3, iam, ...) or literal Terraform types (aws_db_instance)
--exclude-tagExclude by tag (repeatable)
--cacheUse the scan-result cache for faster incremental scans
--refresh-cacheForce-refresh the scan-result cache (distinct from the graph cache used by --refresh on other commands)
--incrementalOnly detect changes since the last scan
--trust-centerEnable Trust Center API auditing (Team+)

Examples

# Scan a specific VPC
replimap scan -p prod --scope vpc:vpc-12345678

# Scan by tag
replimap scan -p prod --entry tag:Application=MyApp

# Scan from an ALB entry point
replimap scan -p prod --entry alb:my-app-alb

# Filter to just RDS + EC2 (service aliases, not literal Terraform types)
replimap scan -p prod --types rds,ec2

# Use cache for faster incremental scans
replimap scan -p prod --cache

RDS scanning models Aurora clusters as aws_rds_cluster / aws_rds_cluster_instance — not generic aws_db_instance blocks — so cluster membership and dependency edges survive into codify.

graph

Generates infrastructure visualizations.

replimap graph --profile prod --format html --output infra.html

Options

OptionDescription
--formathtml (interactive D3, default), mermaid, json
--outputOutput file path
--vpcScope to specific VPC
--allShow all resources (no filtering)
--routesInclude routes and route tables
--no-collapseDisable resource grouping
--open / --no-openOpen in browser after generation

Interactive Graph Features

The HTML graph is a single self-contained file — D3 is inlined, nothing loads from the internet, so it renders fully air-gapped and can be handed to a client as-is. It includes:

FeatureDescription
VPC/Subnet ContainersHierarchical layout — public/private subnets nested in their VPC
Blast RadiusClick a resource to highlight everything it touches
Search & FiltersFind resources by name/type; collapsible filter panel
Legend & TooltipsPer-type legend, hover details, zoom/pan

load

Loads and displays a previously saved graph file.

replimap load graph.db
replimap load graph.json

Accepts .db (SQLite, current format) or .json (legacy format).

profiles

Lists AWS profiles configured in ~/.aws/config and ~/.aws/credentials.

replimap profiles

Infrastructure as Code

codify

Generates Terraform plus an import scaffold from the scanned graph, and reports IaC coverage against your existing state files. Terraform is the only supported output format.

replimap codify --profile prod --output-dir ./terraform

Options

OptionDescription
--dry-runPreview what will be generated without writing files
--output-dirOutput directory for generated code
--coverage-stateA tfstate to match against — local path or s3://bucket/key (repeatable)
--coverage-state-dirDirectory of *.tfstate files to match against
--use-import-scriptEmit imports.sh (CLI import commands) instead of imports.tf blocks
--include-globalInclude global resources (IAM, S3) alongside regional ones
--complianceRoute generated Terraform sources through compliance.tf (soc2, hipaa, pci-dss, nist, fedramp, iso27001, gdpr, nis2, cis, ...)
--state-fileSkip resources already present in an existing terraform.tfstate

Examples

# Preview
replimap codify -p prod --dry-run

# Generate Terraform + import scaffold
replimap codify -p prod --output-dir ./terraform

# Also report which live resources are in NO state file
replimap codify -p prod \
  --coverage-state s3://tf-states/prod/terraform.tfstate \
  --coverage-state-dir ./states

Generated Files

Resources are grouped one file per service:

terraform/
├── vpc.tf / networking.tf / security_groups.tf
├── ec2.tf / compute.tf / alb.tf
├── rds.tf / elasticache.tf / s3.tf / storage.tf / messaging.tf
├── providers.tf / versions.tf
└── imports.tf        # import scaffold (Pro) — correct import ID format per type

Aurora clusters generate a real aws_rds_cluster plus one aws_rds_cluster_instance per member (instead of the standalone, attribute-mismatched aws_db_instance blocks earlier versions produced), with cluster_identifier on each member resolved to a Terraform reference.

There used to be a separate clone command for spinning up a copy of an account in a new environment. It has been removed — codify (adoption of the existing account into Terraform) is the maintained path; CloudFormation and Pulumi output, which only clone ever produced, are no longer supported.

remediate

Generates Terraform remediation code from an audit --format json report.

replimap remediate audit_report.json --output ./fixes

This is a Pro+ capability (shares the same gate as audit's report export).


Analysis

analyze

Analyzes a saved or cached graph for critical infrastructure, single points of failure, and attack surface. Without a GRAPH_FILE argument it uses the cached scan for --profile/--region.

replimap analyze -p prod --critical
replimap analyze graph.db --blast-radius vpc-12345
replimap analyze graph.db --simplify --output simplified.db

Options

OptionDescription
--criticalFind critical resources (SPOFs, high blast radius)
--spofFind single points of failure
--blast-radiusCompute blast radius for a specific resource ID
--simplifyTransitive reduction to simplify the graph
--attack-surfaceAnalyze exposed/public resources
--reportGenerate a comprehensive analysis report
--topNumber of top results to show (default 10)

deps

Explores resource dependencies and blast radius.

replimap deps sg-12345 --region us-east-1

Options

OptionDescription
--formatconsole, tree, table, html, json
--depthLimit analysis depth
--analyzeDeep analysis with specialized analyzers
--vpcScope to specific VPC

Impact Levels

LevelScoreDescription
CRITICAL80-100Core infrastructure (VPC, main DB)
HIGH60-79Production services
MEDIUM40-59Supporting resources
LOW20-39Peripheral resources

Impact estimates are based on AWS API metadata only. Application-level dependencies (hardcoded IPs, config files) are NOT detected. deps is a Pro+ feature.

drift

Experimental. Attribute-level drift comparison is free and marked experimental — on real accounts, terraform plan is still the better answer for "did what I manage change?". What RepliMap ships and stands behind is the opposite question: IaC coverage — what exists that no state file manages.

Detects drift between Terraform state and AWS.

replimap drift --profile prod --state ./terraform.tfstate

Options

OptionDescription
--statePath to local tfstate file
--state-bucketS3 bucket for remote state (with --state-key)
--state-keyS3 key for remote state
--formatconsole, html, json
--managed-onlyOnly report drift for resources managed in the state
--fail-on-driftExit code 1 if any drift detected (CI)
--fail-on-highExit code 1 only for high-severity drift (CI)

Offline Drift Detection (drift-offline)

Runs against a cached scan instead of hitting AWS live — no Terraform installation or AWS connection required.

# Offline drift using cached scan
replimap drift-offline offline -p prod -s ./terraform.tfstate

# Output SARIF for GitHub Security (needs an output path)
replimap drift-offline offline -p prod -s ./terraform.tfstate --sarif drift-results.sarif

# Compare the current cached scan against a previous one
replimap drift-offline compare-scans -p prod --previous baseline.db

validate

Checks infrastructure against topology constraints defined in a YAML file — security policies, tagging standards, architectural rules.

replimap validate --generate-defaults              # bootstrap constraints.yaml
replimap validate -p prod -r us-east-1              # validate
replimap validate -p prod -r us-east-1 --fail-on high  # CI/CD

Options

OptionDescription
--configPath to constraints YAML file (default constraints.yaml)
--fail-onFail on severity: critical, high, medium, low, info
--generate-defaultsGenerate a default constraints file
--outputOutput file for the validation report (JSON or Markdown)

Security & Compliance

audit

Runs security and compliance checks.

replimap audit --profile prod --format html --output audit.html

Options

OptionDescription
--formathtml (default), json
--outputReport path (default: ~/.replimap/reports/<timestamp>/)
--frameworksoc2 (default), apra_cps234, rbnz_bs11, nzism, all
--stateTerraform state file — switches to SOC 2 evidence mode
--fail-on-highExit code 1 if HIGH/CRITICAL issues found (CI)
--fail-on-scoreExit code 1 if score below threshold (CI)
--fixGenerate Terraform remediation code for findings
--vpcScope to a specific VPC

The full terminal summary (score, grade, top issues) is free; exporting the HTML report and the SOC 2 evidence package is Pro+. --framework apra_cps234/rbnz_bs11/nzism require the Sovereign plan; --framework all degrades to soc2 with a notice on lower tiers.

Compliance Frameworks

  • SOC 2
  • APRA CPS 234
  • RBNZ BS11
  • NZISM

residency

Validates data residency for NZ/AU sovereignty — cross-region replication, global tables, read replicas, and CloudFront distributions without geo-restriction.

replimap residency -p prod -r ap-southeast-2
replimap residency --policy au_only -r ap-southeast-2

Options

OptionDescription
--policynz_au (default), au_only, custom
--approved-regionApproved region, repeatable (for --policy custom)

iam

Generates least-privilege IAM policies from graph analysis.

replimap iam for-resource -p prod -r i-0abc123 -s runtime_read
replimap iam list-compute -p prod

Options (for-resource)

OptionDescription
-r, --resourceResource ID or name (required)
-s, --scopePolicy scope (see below)
-E, --enrichGraph enrichment — discover implicit dependencies
-f, --formatjson (default) or terraform
--create-roleGenerate IAM role in Terraform output
--depthMaximum traversal depth (default 3)

iam list-compute shows which Lambda/EC2/ECS resources can have a policy generated for them.

Policy Scopes

ScopeDescription
runtime_readRead-only for runtime operations (default)
runtime_writeWrite access for runtime
runtime_fullFull read/write for runtime
infra_deployFull access for deployment

trust-center

Audit-grade logging of every AWS API call RepliMap makes (Team+). Prove to a client or auditor that the scan was 100% read-only.

# Record API calls during a scan
replimap scan -p prod --trust-center

# Check status
replimap trust-center status

# Generate compliance report (json, csv, or text)
replimap trust-center report
replimap trust-center report --report-format json -o audit.json
replimap trust-center report --report-format csv -o api-calls.csv

# Clear audit sessions
replimap trust-center clear

Configuration

doctor

Runs environment health checks: Python version, AWS credentials, permissions, network connectivity.

replimap doctor
replimap doctor --profile prod --region us-west-2

cache

Manages the cached AWS credentials used to skip re-authentication.

replimap cache status
replimap cache clear

scan-cache

Manages the incremental scan-result cache used by scan --cache / --incremental — separate from the credential cache above.

replimap scan-cache status
replimap scan-cache info --region us-west-2
replimap scan-cache clear --region us-west-2

license

Manage your RepliMap license.

# View license status
replimap license status

# View usage statistics
replimap license usage

# Activate a license key
replimap license activate RM-XXXX-XXXX-XXXX-XXXX

# Deactivate license
replimap license deactivate

upgrade

Opens the checkout flow for a plan upgrade.

replimap upgrade pro
replimap upgrade team
replimap upgrade sovereign

completion

Generates shell completion scripts.

replimap completion bash
replimap completion zsh
replimap completion fish
replimap completion install   # instructions for your shell

Help & Debugging

explain

Gets detailed information — root cause, fix command, docs — for a RepliMap error code.

replimap explain RM-E001
replimap explain ERR-EC2-403-A7X9

errors

Lists all RepliMap error codes.

replimap errors
replimap errors --search permission
replimap errors --category auth

On this page