Skip to main content

AWS Environment Replication Tool - Clone production to staging in minutes

Project description

RepliMap

Python versions Tests License

AWS Infrastructure Staging Cloner

Point at your Production AWS and generate cost-optimized Staging Terraform in minutes.

๐Ÿ”’ Read-only mode | ๐Ÿ“ All data stays local | โšก Minutes, not hours

Overview

RepliMap scans your AWS resources, builds a dependency graph, and generates Infrastructure-as-Code to replicate your environment with intelligent transformations:

  • Instance Downsizing: Automatically reduces EC2/RDS instance sizes for cost savings
  • Environment Renaming: Transforms names from prod to staging
  • Sensitive Data Sanitization: Removes secrets, passwords, and hardcoded credentials
  • Dependency Awareness: Understands VPC โ†’ Subnet โ†’ EC2 relationships

Installation

Recommended: pipx (isolated environment)

# Install pipx if you don't have it
brew install pipx && pipx ensurepath  # macOS
# or: pip install --user pipx && pipx ensurepath  # Linux

# Install RepliMap
pipx install replimap

# Verify installation
replimap --version

# Update later
pipx upgrade replimap

Alternative: pip

pip install replimap

Alternative: uv

uv pip install replimap

Docker (no Python required)

# Pull the image
docker pull replimap/replimap:latest

# Run with AWS credentials
docker run -v ~/.aws:/root/.aws replimap/replimap scan --profile prod --region us-east-1

Quick Start

1. Verify Installation

replimap --version

2. Scan Your AWS Environment

# Basic scan (scans all resources in region)
replimap scan --profile prod --region us-east-1

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

# Scan resources by tag (e.g., Application=MyApp)
replimap scan --profile prod --entry tag:Application=MyApp

# Scan starting from an entry point (e.g., ALB)
replimap scan --profile prod --entry alb:my-app-alb

# Use cached results for faster incremental scans
replimap scan --profile prod --cache

3. Generate Infrastructure-as-Code

# Preview what will be generated
replimap clone --profile prod --mode dry-run

# Generate Terraform files
replimap clone --profile prod --output-dir ./staging-tf --mode generate

# Generate with custom transformations
replimap clone --profile prod --output-dir ./staging-tf \
  --rename-pattern "prod:staging" \
  --downsize \
  --mode generate

4. Apply to Your Staging Account

cd ./staging-tf

# Quick validation (no AWS credentials needed)
make quick-validate

# Or use the test script
./test-terraform.sh

# Full workflow with Makefile
make init                    # Initialize Terraform
make plan                    # Plan changes (outputs tfplan.txt)
make apply                   # Apply the plan

# Alternative: manual Terraform commands
terraform init
terraform plan -out=tfplan
terraform apply tfplan

5. Available Makefile Targets

The generated Terraform includes a comprehensive Makefile:

make help                    # Show all targets
make plan                    # Plan and save to tfplan + tfplan.txt
make plan-target TARGET=...  # Plan specific resource
make plan-json               # Plan with JSON output
make apply                   # Apply saved plan
make destroy                 # Destroy (requires confirmation)
make state-list              # List resources in state
make clean                   # Remove generated files

6. Check License & Usage

# View license status
replimap license status

# View usage statistics
replimap license usage

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

Graph-Based Selection Engine

RepliMap uses intelligent graph traversal instead of simple filtering. This ensures complete, working infrastructure clones.

Selection Modes

# VPC Scope - Select everything in a VPC
replimap scan --profile prod --scope vpc:vpc-12345678
replimap scan --profile prod --scope vpc-name:Production*

# Entry Point - Start from a resource and follow dependencies
replimap scan --profile prod --entry alb:my-app-alb
replimap scan --profile prod --entry tag:Application=MyApp

# Tag-Based - Select by tags
replimap scan --profile prod --tag Environment=Production

YAML Configuration (Advanced)

For complex selection scenarios, use a YAML config file:

# selection.yaml
selection:
  mode: entry_point
  entry_points:
    - type: alb
      name: my-app-*
  dependency_direction: both
  max_depth: 5
  boundary_config:
    network_boundaries:
      - transit_gateway
      - vpc_peering
    identity_boundaries:
      - iam_role
  clone_mode: isolated
  exclusions:
    types:
      - cloudwatch_log_group
    patterns:
      - "*-backup-*"
replimap scan --profile prod --config selection.yaml

Boundary Handling

RepliMap intelligently handles infrastructure boundaries:

Boundary Type Resources Default Behavior
Network Transit Gateway, VPC Peering Create as data source
Identity IAM Roles, Policies Reference existing
Global Route53, CloudFront Create variables

Output Formats

Format Plan Required Status
Terraform HCL Free+ โœ… Available
CloudFormation YAML Solo+ โœ… Available
Pulumi Python Pro+ โœ… Available

Supported Resources (24 Types)

Core Infrastructure

Resource Type Scan Transform Generate
VPC โœ… โœ… โœ…
Subnets โœ… โœ… โœ…
Security Groups โœ… โœ… โœ…
Internet Gateway โœ… โœ… โœ…
NAT Gateway โœ… โœ… โœ…
Route Tables โœ… โœ… โœ…
VPC Endpoints โœ… โœ… โœ…

Compute

Resource Type Scan Transform Generate
EC2 Instances โœ… โœ… โœ…
Launch Templates โœ… โœ… โœ…
Auto Scaling Groups โœ… โœ… โœ…
Application Load Balancers โœ… โœ… โœ…
Network Load Balancers โœ… โœ… โœ…
Target Groups โœ… โœ… โœ…
LB Listeners โœ… โœ… โœ…

Database

Resource Type Scan Transform Generate
RDS Instances โœ… โœ… โœ…
DB Subnet Groups โœ… โœ… โœ…
DB Parameter Groups โœ… โœ… โœ…
ElastiCache Clusters โœ… โœ… โœ…
ElastiCache Subnet Groups โœ… โœ… โœ…

Storage & Messaging

Resource Type Scan Transform Generate
S3 Buckets โœ… โœ… โœ…
S3 Bucket Policies โœ… โœ… โœ…
EBS Volumes โœ… โœ… โœ…
SQS Queues โœ… โœ… โœ…
SNS Topics โœ… โœ… โœ…

Pricing

Plan Monthly Resources/Scan Scans/Month AWS Accounts
Free $0 5 3 1
Solo $49 Unlimited Unlimited 1
Pro $99 Unlimited Unlimited 3
Team $199 Unlimited Unlimited 10
Enterprise $499+ Unlimited Unlimited Unlimited

Feature Matrix

Feature Free Solo Pro Team Enterprise
Terraform Output โœ… โœ… โœ… โœ… โœ…
CloudFormation Output โŒ โœ… โœ… โœ… โœ…
Pulumi Output โŒ โŒ โœ… โœ… โœ…
Async Scanning โŒ โœ… โœ… โœ… โœ…
Custom Templates โŒ โŒ โœ… โœ… โœ…
Web Dashboard โŒ โŒ โœ… โœ… โœ…
Team Collaboration โŒ โŒ โŒ โœ… โœ…
SSO Integration โŒ โŒ โŒ โŒ โœ…
Audit Logs โŒ โŒ โŒ โŒ โœ…

License Management

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

# Check current status
replimap license status

# View usage statistics
replimap license usage

# Deactivate license
replimap license deactivate --yes

CLI Reference

# Show version
replimap --version

# Scan command
replimap scan [OPTIONS]
  --profile, -p TEXT    AWS profile name
  --region, -r TEXT     AWS region to scan [default: us-east-1]
  --output, -o PATH     Output path for graph JSON
  --verbose, -V         Enable verbose logging

# Clone command
replimap clone [OPTIONS]
  --profile, -p TEXT       AWS source profile name
  --region, -r TEXT        AWS region to scan [default: us-east-1]
  --output-dir, -o PATH    Output directory [default: ./terraform]
  --mode, -m TEXT          Mode: 'dry-run' or 'generate' [default: dry-run]
  --downsize/--no-downsize Enable instance downsizing [default: downsize]
  --rename-pattern TEXT    Renaming pattern, e.g., 'prod:stage'

# Load command
replimap load GRAPH_FILE

# License commands
replimap license activate KEY
replimap license status
replimap license usage
replimap license deactivate [--yes]

# Credential cache management
replimap cache status      # Show cached credentials
replimap cache clear       # Clear credential cache

# List AWS profiles
replimap profiles

Configuration

Environment Variables

Variable Default Description
REPLIMAP_DEV_MODE false Enable dev mode (bypasses license limits)
REPLIMAP_MAX_WORKERS 4 Max parallel scanner threads
REPLIMAP_MAX_RETRIES 5 Max retries for AWS rate limiting
REPLIMAP_RETRY_DELAY 1.0 Base delay (seconds) for retry backoff
REPLIMAP_MAX_DELAY 30.0 Maximum delay (seconds) between retries

Dev Mode

For local development and testing, enable dev mode to bypass license restrictions:

# Enable dev mode (unlimited resources, parallel scanning, all outputs)
export REPLIMAP_DEV_MODE=1

# Or inline with command
REPLIMAP_DEV_MODE=1 replimap scan --profile prod

# Values accepted: 1, true, yes (case-insensitive)

AWS Credential Caching

RepliMap caches MFA-authenticated credentials for 12 hours to avoid repeated prompts:

# View cached credentials
replimap cache status

# Clear cache when switching accounts
replimap cache clear

# Disable cache for a single command
replimap scan --profile prod --no-cache

Parallel Scanning

Scanners run in parallel for faster execution (requires Solo+ plan or dev mode):

  • Default: 4 parallel workers
  • Configure with REPLIMAP_MAX_WORKERS environment variable
  • Free tier runs scanners sequentially

AWS Rate Limiting

Built-in retry with exponential backoff handles AWS throttling automatically:

  • Retries on: Throttling, RequestLimitExceeded, TooManyRequestsException, etc.
  • Exponential backoff: 1s โ†’ 2s โ†’ 4s โ†’ 8s โ†’ 16s (up to 30s max)
  • Configurable via environment variables

Security

RepliMap is designed with security as a priority:

  • Read-Only: Only requires read permissions to AWS resources
  • Local Processing: All data processing happens on your machine
  • No Data Upload: Your infrastructure data never leaves your environment
  • Minimal Permissions: See IAM_POLICY.md for recommended policy

Architecture

RepliMap uses a graph-based engine:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Scanners  โ”‚โ”€โ”€โ”€โ–ถโ”‚ Graph Engineโ”‚โ”€โ”€โ”€โ–ถโ”‚ Transformers  โ”‚โ”€โ”€โ”€โ–ถโ”‚  Renderers โ”‚
โ”‚  (AWS API)  โ”‚    โ”‚ (NetworkX)  โ”‚    โ”‚  (Pipeline)   โ”‚    โ”‚(Terraform) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  1. Scanners: Query AWS APIs for VPC, EC2, RDS, S3 resources
  2. Graph Engine: Build dependency graph with NetworkX
  3. Transformers: Apply sanitization, downsizing, renaming
  4. Renderers: Generate Terraform/CloudFormation/Pulumi code

Development

# Clone repository
git clone https://github.com/replimap/replimap.git
cd replimap

# Install with uv (recommended)
uv sync --all-extras --dev

# Run tests
uv run pytest tests/ -v

# Format code
uv run ruff format .

# Lint code
uv run ruff check .

# Type checking
uv run mypy replimap

Project Structure

replimap/
โ”œโ”€โ”€ replimap/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ main.py              # Typer CLI entry point
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ”œโ”€โ”€ graph_engine.py  # NetworkX graph wrapper
โ”‚   โ”‚   โ””โ”€โ”€ models.py        # ResourceNode dataclass
โ”‚   โ”œโ”€โ”€ scanners/
โ”‚   โ”‚   โ”œโ”€โ”€ base.py              # Scanner base class
โ”‚   โ”‚   โ”œโ”€โ”€ async_base.py        # Async scanner support
โ”‚   โ”‚   โ”œโ”€โ”€ vpc_scanner.py       # VPC/Subnet/SG scanner
โ”‚   โ”‚   โ”œโ”€โ”€ ec2_scanner.py       # EC2 scanner
โ”‚   โ”‚   โ”œโ”€โ”€ s3_scanner.py        # S3 scanner
โ”‚   โ”‚   โ”œโ”€โ”€ rds_scanner.py       # RDS scanner
โ”‚   โ”‚   โ”œโ”€โ”€ networking_scanner.py # IGW/NAT/Route Tables
โ”‚   โ”‚   โ”œโ”€โ”€ compute_scanner.py   # ALB/ASG/Launch Templates
โ”‚   โ”‚   โ”œโ”€โ”€ elasticache_scanner.py # ElastiCache clusters
โ”‚   โ”‚   โ”œโ”€โ”€ storage_scanner.py   # EBS/S3 policies
โ”‚   โ”‚   โ””โ”€โ”€ messaging_scanner.py # SQS/SNS
โ”‚   โ”œโ”€โ”€ transformers/
โ”‚   โ”‚   โ”œโ”€โ”€ base.py          # Transformer pipeline
โ”‚   โ”‚   โ”œโ”€โ”€ sanitizer.py     # Sensitive data removal
โ”‚   โ”‚   โ”œโ”€โ”€ downsizer.py     # Instance size reduction
โ”‚   โ”‚   โ”œโ”€โ”€ renamer.py       # Environment renaming
โ”‚   โ”‚   โ””โ”€โ”€ network_remapper.py  # Reference updates
โ”‚   โ”œโ”€โ”€ renderers/
โ”‚   โ”‚   โ”œโ”€โ”€ terraform.py     # Terraform HCL (Free+)
โ”‚   โ”‚   โ”œโ”€โ”€ cloudformation.py # CloudFormation (Solo+)
โ”‚   โ”‚   โ””โ”€โ”€ pulumi.py        # Pulumi Python (Pro+)
โ”‚   โ””โ”€โ”€ licensing/
โ”‚       โ”œโ”€โ”€ manager.py       # License management
โ”‚       โ”œโ”€โ”€ gates.py         # Feature gating
โ”‚       โ””โ”€โ”€ tracker.py       # Usage tracking
โ”œโ”€โ”€ templates/               # Jinja2 templates
โ”œโ”€โ”€ tests/                   # pytest test suite
โ”œโ”€โ”€ .github/workflows/       # CI/CD
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md

Support

License

Proprietary - See LICENSE for details.

Copyright (c) 2025 RepliMap

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

replimap-0.1.0.tar.gz (264.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

replimap-0.1.0-py3-none-any.whl (145.2 kB view details)

Uploaded Python 3

File details

Details for the file replimap-0.1.0.tar.gz.

File metadata

  • Download URL: replimap-0.1.0.tar.gz
  • Upload date:
  • Size: 264.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for replimap-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4297f016caa59036e2bc562a166a4e9dac453d01d8022daf8efdacbaee5c93e4
MD5 3c4d945d945d09f21293dc863a243b19
BLAKE2b-256 b3d674c4f49b28f9d5716ad387d502e50766ba0f172ae6a16aa23a25070e027b

See more details on using hashes here.

File details

Details for the file replimap-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: replimap-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 145.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for replimap-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab4f79b8ce028b1d76cfa1baf7505865494db6d0ebdc1e296ce60b30764bc38b
MD5 c523b9c5a922c926218f427aef903826
BLAKE2b-256 80784a66fd597ed3a1f0221eb75d114e0a69de6ee3ca8198421bf74d4f942452

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page