Automatically translate Terraform plans between cloud providers (AWS, OVH, Hetzner, Azure, GCP) and estimate costs using Infracost. Features a comprehensive SQLite database of cloud resource mappings, daily pricing updates via GitHub Actions, and a simple CLI.
Option 1: Single File Download (Recommended)
# Download the standalone CLI tool - no dependencies needed!
curl -fsSL https://raw.githubusercontent.com/gordonmurray/cloud-rosetta/main/rosetta -o rosetta
chmod +x rosettaOption 2: Clone Repository
git clone https://github.com/gordonmurray/cloud-rosetta.git
cd cloud-rosettaOption 3: System Installation
curl -fsSL https://raw.githubusercontent.com/gordonmurray/cloud-rosetta/main/install.sh | bash# Use in any Terraform project directory
terraform plan # or: tofu plan
./rosetta --provider aws # Get AWS costs
./rosetta --provider ovh # Translate to OVH and estimate costs
./rosetta --provider hetzner # Translate to Hetzner and estimate costsExample Output:
$ ./rosetta --provider aws
Project: tfplan.json
aws_instance.test
├─ Instance usage (Linux/UNIX, on-demand, t3.micro) 730 hours $7.59
└─ root_block_device
└─ Storage (general purpose SSD, gp2) 8 GB $0.80
OVERALL TOTAL $8.39
$ ./rosetta --provider ovh
Translating from AWS to OVH...
Processing: aws_instance.test
Resource type: aws_instance → openstack_compute_instance_v2
Mapped aws 't3.micro' → ovh 'd2-2'
Note: Using AWS pricing as proxy. Actual OVH prices are typically 20-30% lower.
- Universal Translation: Convert between AWS ↔ OVH ↔ Hetzner ↔ Azure ↔ GCP
- Cost Estimation: Uses Infracost with intelligent provider mapping
- Comprehensive Database: 79+ resource types, 76+ instance types
- Auto-Updates: Daily pricing updates via GitHub Actions
- Zero Dependencies: Single file, auto-downloads database
- Enterprise Ready: Offline capability, version control, rollbacks
# Compare costs across providers for the same infrastructure
terraform plan
./rosetta --provider aws # $45.67/month
./rosetta --provider ovh # ~$32/month (estimated)
./rosetta --provider hetzner # ~$28/month (estimated)# Estimate savings when moving from AWS to OVH
./rosetta --provider aws # Current AWS costs
./rosetta --provider ovh # Projected OVH costs# Get cost estimates for procurement without cloud accounts
./rosetta --provider hetzner --format json > budget.jsonView all supported resource types (79+)
- Instances:
aws_instance↔openstack_compute_instance_v2↔hcloud_server - Launch Templates:
aws_launch_template - Auto Scaling:
aws_autoscaling_group - Key Pairs:
aws_key_pair↔openstack_compute_keypair_v2↔hcloud_ssh_key
- Block Storage:
aws_ebs_volume↔openstack_blockstorage_volume_v3↔hcloud_volume - Object Storage:
aws_s3_bucket↔openstack_objectstorage_container_v1 - File Systems:
aws_efs_file_system,aws_fsx_lustre_file_system - Snapshots:
aws_ebs_snapshot↔openstack_blockstorage_snapshot_v3↔hcloud_snapshot
- VPC/Networks:
aws_vpc↔openstack_networking_network_v2↔hcloud_network - Subnets:
aws_subnet↔openstack_networking_subnet_v2↔hcloud_network_subnet - Security Groups:
aws_security_group↔openstack_networking_secgroup_v2↔hcloud_firewall - Load Balancers:
aws_lb↔openstack_lb_loadbalancer_v2↔hcloud_load_balancer - Elastic IPs:
aws_eip↔openstack_networking_floatingip_v2↔hcloud_floating_ip
- Instances:
aws_db_instance↔openstack_db_instance_v1 - Clusters:
aws_db_cluster↔openstack_db_cluster_v1 - Caching:
aws_elasticache_cluster
- Container Clusters:
aws_ecs_cluster↔openstack_containerinfra_cluster_v1 - Kubernetes:
aws_eks_cluster↔openstack_containerinfra_cluster_v1 - Functions:
aws_lambda_function - API Gateway:
aws_api_gateway_rest_api
- CloudWatch:
aws_cloudwatch_metric_alarm,aws_cloudwatch_log_group - IAM:
aws_iam_role,aws_iam_policy,aws_iam_user - Backup:
aws_backup_plan,aws_backup_vault
graph TD
A[Terraform Plan] --> B[Rosetta CLI]
B --> C[Download DB from GitHub]
C --> D[SQLite Database]
D --> E[Resource Translation]
E --> F[Infracost]
F --> G[Cost Estimates]
H[GitHub Actions] --> I[Daily Price Updates]
I --> J[Commit to Repo]
J --> K[GitHub Releases]
K --> C
- Plan Generation: Rosetta generates a Terraform JSON plan file from your project
- Translation: Resources are translated using the SQLite database mappings
- Cost Estimation: The translated JSON plan is passed to Infracost for pricing
- No HCL Generation: Works entirely with JSON plan files, not Terraform code
📖 Detailed Infracost Integration Documentation
-- Resource mappings between providers
resource_mappings (aws_type, ovh_type, hetzner_type, category)
-- Instance types with detailed specs
instance_types (provider, instance_type, vcpu, memory_gb, hourly_price)
-- Regional mappings with geographic data
regions (provider, region_code, latitude, longitude)
-- OS/Image mappings
images (provider, image_name, os_family, os_version)# 1. Fork this repository
# 2. Update GitHub Actions secrets (optional)
# 3. Customize resource mappings in scripts/populate_db.py
# 4. Use your fork:
./rosetta --repo your-username/cloud-rosetta --provider ovhOur database provides intelligent mappings based on:
- Hardware specs: vCPU count, RAM, storage
- Performance class: General purpose, compute optimized, memory optimized
- Generation: Current vs previous generation
- Geographic proximity: Nearest data center
- Continent preference: Same continent when possible
- Pricing zones: Similar cost regions
| OVH | AWS | Hetzner | Notes |
|---|---|---|---|
| d2-2 (1 vCPU, 2GB) | t3.small | cx11 | Entry-level instances |
| b2-15 (4 vCPU, 15GB) | m5.xlarge | cpx31 | General purpose |
| c2-30 (8 vCPU, 30GB) | c5.2xlarge | ccx31 | Compute optimized |
| r2-60 (8 vCPU, 60GB) | r5.2xlarge | ccx41 | Memory optimized |
- AWS: Direct Infracost pricing (100% accurate)
- OVH: AWS pricing as proxy (~70-80% of actual OVH costs)
- Hetzner: AWS pricing as proxy (~50-60% of actual Hetzner costs)
- Daily updates: Pricing refreshed automatically
View real-world examples
# main.tf
resource "aws_instance" "web" {
instance_type = "t3.medium"
ami = "ami-ubuntu-22.04"
}
resource "aws_ebs_volume" "storage" {
size = 100
type = "gp3"
}terraform plan
./rosetta --provider aws # $30.45/month
./rosetta --provider ovh # ~$21/month (estimated)
./rosetta --provider hetzner # ~$18/month (estimated)resource "aws_instance" "web" {
count = 2
instance_type = "m5.large"
}
resource "aws_db_instance" "postgres" {
instance_class = "db.t3.medium"
allocated_storage = 100
}
resource "aws_lb" "main" {
load_balancer_type = "application"
}./rosetta --provider aws # $156.78/month
./rosetta --provider ovh # ~$110/month (estimated)
./rosetta --provider hetzner # ~$95/month (estimated)- Infracost Integration Details - How Rosetta works with Infracost
- Database Schema - SQLite database structure (embedded)
- Translation Logic - Resource mapping implementation (embedded)
- Fork the repository
- Add provider mappings in
scripts/populate_db.py - Update the embedded database manager in
rosetta - Add tests
- Submit a PR
- Open an issue with the mapping problem
- Provide resource specifications
- Suggest better equivalent instances
- We'll update the database
- Add pricing APIs to embedded database manager in
rosetta - Update the database schema if needed
- Test with real workloads
- Document accuracy improvements
MIT License - feel free to use in commercial projects.