migrasi

Migrasi dari Terraform ke Pulumi

Lisensi dan ketentuan

Terraform
Other, Source available
Pulumi
Apache-2.0, Open source
Kecocokan
Pengganti penuh Infrastructure in general-purpose languages instead of HCL.

Halaman ini ditulis dalam bahasa Inggris.

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

Panduan resmi

Panduan migrasi Pulumi ↗

Ditinjau pada 2026-10-06.

Sumber

Alternatif lain untuk Terraform →