Loading Terraform to Pulumi Converter...

How to Convert Terraform to Pulumi - Step by Step Guide

Step 1

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.

Paste directly: Copy your Terraform HCL and paste into the input editor
Upload a file: Click "Upload" to select a .tf or .hcl file
Try the sample: Click "Sample" to load example Terraform configuration
Step 2

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.

Resource mapping: aws_s3_bucket becomes aws.s3.Bucket
Variable conversion: Terraform variables become Pulumi config values
Syntax highlighting: Color-coded TypeScript for readability
Step 3

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.

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

Deploy with Pulumi CLI

Initialize a Pulumi project and deploy using the converted code. You can import existing Terraform stateto avoid recreating infrastructure.

Initialize project: Run pulumi new aws-typescript
Install dependencies: Run npm install @pulumi/aws
Deploy: Run pulumi up to preview and deploy

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