migration

Migrer de Terraform vers Pulumi

Licence et conditions

Terraform
Other, Source disponible
Pulumi
Apache-2.0, Open source
Type de remplacement
Remplacement complet Infrastructure in general-purpose languages instead of HCL.

Cette page est rédigée en anglais.

Compatibility

Pulumi’s guide offers routes that keep your HCL as well as routes that convert it:

Before you switch

To convert the code yourself:

  1. Run pulumi convert --from terraform --language <typescript|python|go|csharp> in the folder holding the HCL. Variables, outputs, resources, data sources and modules (as Pulumi components) are supported, along with almost all HCL2 expressions.
  2. Import the existing resources with pulumi import --from terraform ./terraform.tfstate. Imported resources are marked protected. If you stay on runtime: hcl, use pulumi import --from hcl terraform.tfstate from the project directory instead.
  3. Run pulumi preview and expect no changes before the first pulumi up.

The guide also describes a state-first route with the pulumi-terraform-migrate plugin (pulumi plugin run terraform-migrate -- stack --from ... --to ... --out ... --plugins ...), which writes a Pulumi state file and a list of required plugins, followed by pulumi stack import. It has to be repeated for each Terraform stack. Pulumi’s recommended route is Neo, its hosted agent, which needs Pulumi Neo access, the Pulumi GitHub app and cloud credentials in Pulumi ESC.

Pitfalls

Guide officiel

Guide de migration de Pulumi ↗

Relue le 2026-10-06.

Sources

Autres alternatives à Terraform →