Loading CloudFormation to Terraform Converter...

How to Convert CloudFormation to Terraform - Complete Guide

Step 1

Input Your CloudFormation Template

Start by providing your AWS CloudFormation template. Whether you're migrating from CloudFormation to Terraform or modernizing your Infrastructure as Code, you have multiple options:

Paste directly: Copy your CloudFormation template (JSON or YAML) and paste it into the input editor
Upload files: Click "Upload" to select your .template, .json, or .yaml files
Try the sample: Click "Sample" to load a complete AWS infrastructure example
Both formats supported: JSON and YAML CloudFormation templates are both supported with full intrinsic function support
Step 2

Automatic Conversion Process

Our intelligent converter analyzes your CloudFormation template and generates idiomatic Terraform HCL:

Resource mapping: Converts 30+ AWS CloudFormation resource types to equivalent Terraform AWS provider resources
Intrinsic functions: Translates Ref, !GetAtt, !Sub, !Join to Terraform expressions and functions
Parameters → Variables: CloudFormation Parameters become Terraform variables with proper types and defaults
Outputs preserved: CloudFormation Outputs are converted to Terraform outputs maintaining descriptions and values
Provider setup: Automatically generates terraform required_providers block and AWS provider configuration
Step 3

Review Generated Terraform Code

Review the generated main.tf configuration in the output panel. The converter creates production-ready Terraform code:

Terraform blocks: Includes required_version and required_providers for AWS
Variables defined: All CloudFormation Parameters become properly typed Terraform variables
Resources configured: EC2, VPC, S3, RDS, Lambda, IAM, and more - all correctly mapped to Terraform syntax
Outputs exported: CloudFormation Outputs become Terraform outputs for use in other modules or stacks
Step 4

Download and Deploy with Terraform

Now you're ready to deploy your AWS infrastructure with Terraform! Download the generated code and start managing your resources:

Download the file: Click "Download" to save main.tf to your Terraform project directory
Initialize Terraform: Run terraform init to download the AWS provider
Review the plan: Run terraform plan to see what resources will be created
Apply changes: Run terraform apply to provision your AWS infrastructure
Import existing resources: Use terraform import to manage resources that already exist in your AWS account

Quick Start Commands

Essential Terraform CLI commands:

# Initialize Terraform
terraform init
# Preview changes
terraform plan
# Apply infrastructure
terraform apply

Frequently Asked Questions

How does CloudFormation to Terraform conversion work?

The converter parses your CloudFormation template (JSON or YAML) and intelligently maps AWS resources to equivalent Terraform AWS provider resources. It converts intrinsic functions like Ref, !GetAtt, and !Sub to Terraform expressions and generates idiomatic HCL configuration that follows Terraform best practices.

Which AWS resources and services are supported?

The converter supports 30+ common AWS resource types including EC2 instances, VPCs, Subnets, Security Groups, S3 buckets, RDS databases, Lambda functions, IAM roles and policies, ELB/ALB load balancers, Auto Scaling groups, CloudWatch alarms, SNS topics, SQS queues, API Gateway REST APIs, and ECS clusters. Complex nested stacks or custom CloudFormation resources may require manual review after conversion.

Is the generated Terraform code production-ready?

The generated Terraform configuration provides a solid, well-structured starting point that follows Terraform conventions. However, we recommend reviewing the output, adjusting resource arguments as needed for your specific use case, and running terraform plan before applying to production. Some advanced CloudFormation features (like nested stacks, macros, or custom resources) may need manual translation or refinement.

How are CloudFormation Parameters and Outputs handled?

Yes! CloudFormation Parameters are automatically converted to Terraform variables with proper types (string, number, list) and default values preserved. CloudFormation Outputs become Terraform outputs with descriptions intact. This preserves your infrastructure's parameterization and makes the migration seamless for existing workflows.

Is my CloudFormation template secure during conversion?

Absolutely! All conversion happens entirely client-side in your browser using JavaScript. Your CloudFormation templates, AWS resource configurations, IAM policies, and any sensitive data never leave your computer or get sent to any server. This makes it completely safe for templates containing production AWS configurations, security groups, or internal infrastructure details.

What about CloudFormation intrinsic functions and pseudo parameters?

Common intrinsic functions are automatically converted: !Ref becomes resource references, !GetAtt becomes attribute access, !Sub becomes string interpolation, and !Join becomes the join() function. Pseudo parameters like AWS::Region and AWS::AccountId are mapped to Terraform data sources. More complex functions may need manual adjustment after conversion.