ubx convert --from terraform handles the mechanical conversion — it reads your .tf files and generates equivalent .iac source. The converter handles the obvious cases automatically: variable → input, output → output, resource → unit. The cases that require manual attention — Terraform resource type names that differ from Pulumi’s, versioning sub-resources that become sub-blocks, multi-resource patterns that collapse to a single block — are flagged in the MIGRATION.md the converter produces alongside the converted files.
What you’ll learn
- How
ubx convert --from terraformconverts.tffiles to.iac - The common manual fixups required after conversion
- How to import existing Terraform-managed resources into Pulumi state
Why this matters
You don’t need to migrate everything at once. Convert one module, import its resources, verify it validates and plans correctly, then move on to the next. The rest of your Terraform configuration keeps running unchanged during the migration — ubx and Terraform can coexist in the same account, managing separate resources.
The source code
How it works
Run ubx convert to generate .iac files
ubx convert --from terraform ./terraform-before/ --out ./ reads all .tf files in the source directory and generates .iac equivalents. The converter handles variable → input, output → output, resource → unit, and basic expression translation (var.x → input.x, resource.type.name.attr → unit.type.name.attr).Apply manual fixups from MIGRATION.md
The converter produces a
MIGRATION.md alongside the .iac files listing cases it couldn’t handle automatically. Common fixups: aws_s3_bucket → aws_s3_bucket_v2 (Pulumi naming differs from Terraform), separate aws_s3_bucket_versioning resource → versioning sub-block inside the bucket, aws_db_instance → aws_rds_instance.Common conversion patterns
| Terraform | ubx .iac | Notes |
|---|---|---|
variable "x" {} | input "x" {} | Direct mapping |
output "x" {} | output "x" {} | Direct mapping |
resource "aws_s3_bucket" "x" {} | unit "aws_s3_bucket_v2" "x" {} | Provider naming differs |
var.x | input.x | Reference syntax |
resource.type.name.attr | unit.type.name.attr | Pending ref syntax |
aws_s3_bucket_versioning resource | versioning {} sub-block | Sub-resource → sub-block |
aws_db_instance | aws_rds_instance | Pulumi vs Terraform naming |
Common mistakes
Run it
What you learned
ubx convert --from terraform converts .tf files to .iac automaticallyMIGRATION.md lists fixups that require manual attention after conversionimport blocks adopt existing resources into Pulumi state without recreating themNext steps
Migrate from Pulumi
Convert existing Pulumi TypeScript programs to .iac
Input from Terraform state
Consume Terraform outputs during incremental migration
Full runnable example: github.com/ubiquex/ubx-examples/54-migration-from-terraform

