Loading Terraform to Pulumi Converter...
How to Convert Terraform to Pulumi - Step by Step Guide
Paste Your Terraform Configuration
Copy your Terraform HCL into the left editor, or upload a .tf or .hcl file with the Upload button. It reads variables, locals, resources, data sources and outputs; AWS resource types are mapped to Pulumi classes, and anything it does not map is listed in a Notes comment.
Review the Pulumi TypeScript Output
Common AWS resource types are mapped to their @pulumi/aws class, variables become config reads and outputs become exports. Resource references and interpolations become TypeScript identifiers and pulumi.interpolate.
Download or Copy the Pulumi Code
Copy the converted Pulumi TypeScript or download it as a .ts file. The code starts with the imports for the detected provider and the Notes comment.
Deploy with Pulumi CLI
Start a Pulumi project and deploy the converted code. You can import existing resourceswith pulumi import so you do not recreate infrastructure.
pulumi new aws-typescriptnpm install @pulumi/awspulumi preview then pulumi upFrequently Asked Questions
What does this converter turn into Pulumi code?
Each variable block becomes a pulumi.Config read — config.get, getNumber, getBoolean or getObject, with the default after ?? and config.require when there is no default. locals become plain const values, resources of a mapped AWS type become new aws.* objects, and every output becomes an exported constant. References such as aws_vpc.main.id and an interpolated string become identifiers and pulumi.interpolate, and depends_on becomes the dependsOn option.
Which resource types does it handle?
Around forty common AWS types are mapped, including S3 buckets, EC2 instances, VPCs, subnets, security groups, route tables, RDS instances, Lambda functions, IAM roles and policies, DynamoDB tables, SNS and SQS, load balancers and ECS. A resource whose type is not mapped — including Azure, Google Cloud and Kubernetes resources — is written as a const set to undefined and named in the Notes comment at the top, so references still compile and nothing is dropped without a trace.
Are the property names ready for @pulumi/aws?
They are camelCased from the Terraform argument names, so cidr_block becomes cidrBlock. Tag keys and other map keys are kept exactly as you wrote them. The Pulumi AWS provider renames or nests a few properties differently, so run tsc or let your editor check the program against the @pulumi/aws types and fix whatever it flags.
Will numbers and quoted values stay exact?
Yes. A number is written with the digits you typed, so 14.50 stays 14.50 and a long id like 8901240544102066246 is not rounded in the code. A quoted "00501" stays a string, and quotes, backslashes and interpolation markers are escaped so every string is valid TypeScript. Keep in mind that a JavaScript number only holds about 15 digits exactly, so a value that long is best passed as a string.
What about count, for_each and provisioners?
Loops (count and for_each), provisioner, connection and dynamic blocks, conditionals and for expressions have no one-to-one Pulumi form, so they are not guessed. Each is named in the Notes comment, and you rewrite that part as an ordinary TypeScript loop or expression.
How do I run the converted program?
Create a project with pulumi new aws-typescript, replace index.ts with the downloaded file, set any config values with pulumi config set, and run pulumi preview before pulumi up. If the infrastructure already exists, import it with pulumi import instead of creating duplicates.
Is my configuration uploaded anywhere?
No. The HCL is read and converted in your browser, nothing is sent to a server and nothing is kept, so reloading the page starts with an empty editor.
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