Pulumi to Terraform Converter - Convert Pulumi TypeScript to Terraform HCL
Free online Pulumi to Terraform converter tool to migrate infrastructure code to HCL for HashiCorp workflows.
Loading Pulumi to Terraform Converter...
How to Convert Pulumi to Terraform - Step by Step Guide
Paste Your Pulumi TypeScript Code
Copy your Pulumi TypeScript code from your index.ts file into the left editor. You can upload .ts files using the Upload button. The converter works with Pulumi code for AWS, Azure, GCP, and Kubernetes providers.
Review the Terraform HCL Output
The converter automatically maps Pulumi resources to Terraform equivalents and converts TypeScript syntax to HCL. Pulumi config values become Terraform variables, and exports become outputs.
Download or Copy Terraform Configuration
Export your converted Terraform HCL. The generated configuration includes required provider blocks and can be used with the Terraform CLI after review.
Initialize and Apply with Terraform
Run Terraform commands to initialize and deploy. If migrating existing infrastructure, use terraform importto avoid recreating resources.
terraform init to download providersterraform plan to previewterraform apply after reviewFrequently Asked Questions
What is Pulumi to Terraform conversion?
Pulumi to Terraform conversion transforms Pulumi infrastructure code (TypeScript, Python, etc.) into Terraform's HCL. While Pulumi uses programming languages, Terraform uses declarative HCL. Teams convert for organizational standards, team expertise, or tooling requirements.
Why migrate from Pulumi to Terraform?
Teams migrate for existing Terraform expertise, larger module ecosystem (10,000+ modules), better integration with existing CI/CD and security tools, avoiding Pulumi Cloud costs (using free S3/Azure backends), preferring declarative HCL over programmatic approaches, and vendor neutrality with HashiCorp's independence.
Does this support all Pulumi resource types?
The converter supports commonly used Pulumi resources across AWS, Azure, GCP, and Kubernetes, including S3, EC2, Lambda, VPCs, and more. It handles config values and exports. Pulumi component resources need conversion to Terraform modules, and programmatic loops require count or for_each.
How do I handle Pulumi state when migrating?
Use terraform import to import resources into Terraform state without modifying infrastructure. Export Pulumi state withpulumi stack export for documentation. Test in non-production first and migrate resources in batches.
What Pulumi features don't translate to Terraform?
Component resources become Terraform modules, stack references become terraform_remote_state, TypeScript loops need count/for_each, dynamic providers need Terraform provider development, Pulumi encrypted config needs external secret managers, and unit tests need conversion to Terratest or similar frameworks.
Is the converted code production-ready?
The converter generates syntactically correct HCL but requires review. Verify property mappings, adjust provider configs, add depends_on if needed, configure backend for state storage, add lifecycle rules and timeouts, set up variable files, and test thoroughly in non-production with terraform plan.
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