migração

Migrar de Terraform para Pulumi

Licença e termos

Terraform
Other, Código disponível
Pulumi
Apache-2.0, Código aberto
Tipo de substituição
Substituição completa Infrastructure in general-purpose languages instead of HCL.

Esta página está escrita em inglês.

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

Guia oficial

Guia de migração de Pulumi ↗

Revisado em 2026-10-06.

Fontes

Outras alternativas a Terraform →