CloudFormation to Terraform Converter - Convert AWS CFN to Terraform HCL
Free online tool to convert AWS CloudFormation templates to Terraform configuration. Generate Terraform HCL from CloudFormation JSON or YAML instantly.
How to Convert CloudFormation to Terraform - Complete Guide
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:
.template, .json, or .yaml filesAutomatic Conversion Process
Our intelligent converter analyzes your CloudFormation template and generates idiomatic Terraform HCL:
Ref, !GetAtt, !Sub, !Join to Terraform expressions and functionsReview Generated Terraform Code
Review the generated main.tf configuration in the output panel. The converter creates production-ready Terraform code:
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:
main.tf to your Terraform project directoryterraform init to download the AWS providerterraform plan to see what resources will be createdterraform apply to provision your AWS infrastructureterraform import to manage resources that already exist in your AWS accountQuick Start Commands
Essential Terraform CLI commands:
# Initialize Terraformterraform init# Preview changesterraform plan# Apply infrastructureterraform applyFrequently 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.
Related Tools
Terraform to CloudFormation
Convert Terraform HCL configurations to AWS CloudFormation templates in YAML or JSON
Azure ARM to Terraform
Convert Azure Resource Manager templates to Terraform HCL with azurerm provider
Ansible to Terraform
Convert Ansible playbooks to Terraform HCL for AWS, Azure, and GCP resources
ARM to Bicep
Convert Azure Resource Manager (ARM) templates to Bicep with modern syntax and improved readability
Bicep to ARM
Convert Bicep files to Azure Resource Manager (ARM) JSON templates for deployment and tooling compatibility
CloudFormation to Pulumi
Convert AWS CloudFormation templates to Pulumi TypeScript for modern infrastructure as code