Loading Pulumi to Terraform Converter...
How to Convert Pulumi to Terraform
Paste your Pulumi TypeScript
Copy the Pulumi TypeScript program from your index.ts into the left editor. Plain JavaScript works too. Python, Go, C# and YAML programs are recognised and you get a message instead of a half-read result.
Read the Terraform HCL
Each Pulumi resource becomes a Terraform resource block, config values become variables and exports become outputs. The comment lines at the top of the output tell you what still needs a human: types named by convention, settings kept as quoted text, and anything that was skipped.
const vpc = new aws.ec2.Vpc("main-vpc", {
cidrBlock: "10.0.0.0/16",
tags: { Name: `${environment}-vpc` },
});becomes
resource "aws_vpc" "vpc" {
cidr_block = "10.0.0.0/16"
tags = {
Name = "${var.environment}-vpc"
}
}Copy or download main.tf
Copy the HCL or download it as main.tf. Both always match what is in the input editor at that moment, even if you click right after typing.
Initialise, validate and import
Run the Terraform CLI against the file. For infrastructure Pulumi already manages, use terraform import so nothing gets recreated, and only remove the stack from Pulumi once Terraform owns everything.
terraform init to download the providersterraform validate; it points at argument names or blocks that need adjustingterraform plan and read it before any applyGoing the other way? The Terraform to Pulumi converter turns HCL into Pulumi TypeScript, and CloudFormation to Terraform handles stacks written as templates.
Frequently Asked Questions
What does the converter turn into Terraform?
It reads the program the way TypeScript would and looks at the top-level statements. config.get, require, getNumber, getBoolean, getObject and the secret versions become variable blocks with a matching type; a default after || or ?? becomes the default, and secrets get sensitive = true. Each new aws.s3.Bucket("name", {...}) style call becomes a resource block, other top-level constants go into locals, getAmi-style lookups become data blocks, and every export const becomes an output.
Which resource types are mapped?
About 55 common AWS types (S3, VPC and subnets, security groups, EC2, Lambda, IAM, RDS, DynamoDB, SQS, SNS, ECS, EKS, load balancers and more) and a handful of Azure classic types are mapped from a fixed list. Other AWS, Azure classic, GCP, Kubernetes and Random resources get a type name built from the Pulumi name, with a note asking you to check it in the Terraform registry. Resources from azure-native, awsx, component resources and packages the page does not know are skipped and named in a note.
Are the arguments renamed to the provider schema?
Only to snake_case: cidrBlock becomes cidr_block and forceDestroy becomes force_destroy, which matches most AWS arguments, but nothing is checked against the provider schema. Nested settings are written as name = { ... }; where Terraform expects a nested block, remove the equals sign. Keys inside tags, labels, annotations and similar maps are kept exactly as you wrote them.
How are references, templates and resource options handled?
vpc.id becomes aws_vpc.vpc.id, a config value becomes var.name, template strings and pulumi.interpolate become HCL strings with ${...} inside, and JSON.stringify becomes jsonencode. The dependsOn option becomes depends_on, protect becomes prevent_destroy and ignoreChanges becomes ignore_changes. Anything that only runs at deploy time, such as .apply(), pulumi.all, loops or functions, cannot be written in HCL: it is kept as quoted text or skipped, and a note at the top of the output says which line.
Will long IDs, prices or quoted text change?
No. Numbers are written with the digits you typed, so 8901240544102066246 stays exactly that and 14.50 keeps its trailing zero, while "00501" stays a string. Quotes, backslashes and line breaks are escaped for HCL, and a literal ${ or %{ inside a string is written as $${ or %%{ so Terraform does not try to fill it in.
Is my code uploaded anywhere?
No. The conversion runs in your browser, nothing is sent to a server and nothing is kept, so a reload starts with an empty editor. Before you apply the result, run terraform init, terraform validate and terraform plan, and bring resources Pulumi already created under Terraform with terraform import instead of creating them again.
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