Terraform to CloudFormation Converter - Convert HCL to AWS Templates Online
Free online Terraform to CloudFormation converter tool to transform HCL configurations to AWS CloudFormation templates with support for resources and variables.
Loading converter...
How to Convert Terraform to CloudFormation - Step by Step Guide
Prepare Your Terraform Configuration
Locate your Terraform configuration files (typically main.tf, variables.tf, or resources.tf). Terraform uses HashiCorp Configuration Language (HCL) to define infrastructure. Copy the contents of your Terraform files.
terraform validate to ensure your configuration is syntactically correctPaste and Convert
Paste your Terraform HCL code into the left editor panel. The converter parses your Terraform resource blocks, variables, and outputs, then maps them to equivalent CloudFormation syntax. Terraform references like aws_vpc.main.id are automatically converted to CloudFormation intrinsic functions.
aws_instance are converted to AWS::EC2::InstanceReview and Customize Output
Examine the generated CloudFormation template in the right panel. While the converter handles common AWS resources and patterns, some Terraform-specific features don't have direct CloudFormation equivalents. Review property mappings and ensure all required CloudFormation properties are present.
dynamic blocks need manual conversionDownload and Deploy to AWS
Download the converted CloudFormation template in your preferred format. Save it as template.yaml or stack.json. Deploy using the AWS CloudFormation console, AWS CLI, or AWS CDK. Always test in a dev/staging environment first.
aws cloudformation validate-template before deployingRelated Tools
CloudFormation to Terraform
Convert AWS CloudFormation templates to Terraform HCL configuration
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