AWS Environment Replication Tool - Clone production to staging in minutes
Project description
RepliMap
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
prodtostaging - 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 (format: RM-XXXX-XXXX-XXXX-XXXX)
replimap license activate RM-XXXX-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
License keys use the format RM-XXXX-XXXX-XXXX-XXXX (RM prefix for RepliMap brand).
# Activate a license key
replimap license activate RM-XXXX-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_LICENSE_API |
https://replimap-api... |
License validation API URL |
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_WORKERSenvironment 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) โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโ
- Scanners: Query AWS APIs for VPC, EC2, RDS, S3 resources
- Graph Engine: Build dependency graph with NetworkX
- Transformers: Apply sanitization, downsizing, renaming
- 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
- Documentation: https://docs.replimap.io
- Issues: GitHub Issues
- Email: support@replimap.io
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file replimap-0.1.3.tar.gz.
File metadata
- Download URL: replimap-0.1.3.tar.gz
- Upload date:
- Size: 108.4 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baf99d9291804f2d4bacbc1ac1fa337fa72493cd77f0cb55b2d944f213b5b087
|
|
| MD5 |
d511985577cfe6c0681dcf0f56a16fc2
|
|
| BLAKE2b-256 |
7b493695c613320d75e05a1c0a7da359ffa72df42e24dbac7d8caea9cb010b4b
|
File details
Details for the file replimap-0.1.3-py3-none-any.whl.
File metadata
- Download URL: replimap-0.1.3-py3-none-any.whl
- Upload date:
- Size: 145.9 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
185a3dee456c1a6ba379155ee4954660c1fcf5050b23976cfadcd2f16677bdd4
|
|
| MD5 |
8d92dfac0f09b2f013778d73ef85db45
|
|
| BLAKE2b-256 |
7bec2f7c482b1aa6ae23d1bb7b28af0de85debb9f029377313b3befa0b9b3c4c
|