Loading Pulumi to Terraform Converter...

How to Convert Pulumi to Terraform - Step by Step Guide

Step 1

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.

Paste directly: Copy Pulumi TypeScript and paste into the input editor
Upload a file: Click "Upload" to select a .ts file
Try the sample: Click "Sample" to load example Pulumi code
Step 2

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.

Resource mapping: aws.s3.Bucket becomes aws_s3_bucket
Config conversion: Pulumi config becomes Terraform variables
Provider blocks: Terraform and provider blocks generated automatically
Step 3

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.

Copy to clipboard: One-click copying for pasting into your project
Download as file: Save as a main.tf file for your Terraform project
Validation status: Green checkmark confirms successful conversion
Step 4

Initialize and Apply with Terraform

Run Terraform commands to initialize and deploy. If migrating existing infrastructure, use terraform importto avoid recreating resources.

Initialize: Run terraform init to download providers
Plan changes: Run terraform plan to preview
Apply: Run terraform apply after review

Frequently 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.