Terraform to Pulumi Converter - Convert Terraform HCL to Pulumi TypeScript
Free online Terraform to Pulumi converter tool to migrate infrastructure configurations to modern IaC with TypeScript.
Loading Terraform to Pulumi Converter...
How to Convert Terraform to Pulumi - Step by Step Guide
Paste Your Terraform Configuration
Copy your Terraform HCL configuration into the left editor. You can upload .tf or .hcl files using the Upload button. The converter supports variables, locals, resources, data sources, and outputs across AWS, Azure, GCP, and Kubernetes providers.
Review the Pulumi TypeScript Output
The converter automatically maps Terraform resource types to Pulumi equivalents and converts HCL syntax to TypeScript. Terraform interpolations and resource references are converted to TypeScript template literals.
Download or Copy the Pulumi Code
Export your converted Pulumi TypeScript code. The code includes necessary imports for the detected provider and can be directly used after installing dependencies.
Deploy with Pulumi CLI
Initialize a Pulumi project and deploy using the converted code. You can import existing Terraform stateto avoid recreating infrastructure.
pulumi new aws-typescriptnpm install @pulumi/awspulumi up to preview and deployFrequently Asked Questions
What is Terraform to Pulumi conversion?
Terraform to Pulumi conversion transforms HashiCorp Terraform HCL files into Pulumi code using TypeScript, Python, Go, or other languages. While Terraform uses HCL, Pulumi leverages general-purpose programming languages, providing better IDE support, type checking, code reusability, and native testing.
Why migrate from Terraform to Pulumi?
Teams migrate for real programming languages (TypeScript, Python with full IDE support), advanced abstractions (reusable components as npm packages), testing capabilities (Jest, pytest), unified multi-cloud management, better state management with built-in secrets encryption, and policy as code enforcement through CrossGuard.
Does this converter support all Terraform resources?
The converter supports commonly used resources across AWS, Azure, GCP, and Kubernetes, including EC2, S3, Lambda, VPCs, security groups, and more. It handles variables, locals, data sources, and outputs. Unsupported resources are noted with comments. Complex features like provisioners may require manual refactoring.
How do I migrate existing Terraform state?
Use pulumi import to import resources into Pulumi state without modifying infrastructure, or use the tf2pulumi CLI tool to convert both HCL and state files. Test in non-production first and migrate in small batches.
Can I convert Pulumi back to Terraform?
While there's no official Pulumi-to-Terraform converter, you can export state withpulumi stack export. However, Pulumi's programmatic features don't have Terraform equivalents. Consider using Pulumi's terraform.RemoteStateReference for interoperability.
Is the converted code production-ready?
The converter generates syntactically correct Pulumi code, but review and testing are essential. Terraform provisioners, null_resource, and dynamic blocks may need manual refactoring. Add error handling, configure stack settings, write tests, and always test in non-production environments with pulumi preview.
Related Tools
CloudFormation to Terraform
Convert AWS CloudFormation templates to Terraform HCL configuration
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