- Home
- Skills
- Pulumi
- Agent Skills
- Pulumi Terraform To Pulumi
pulumi-terraform-to-pulumi_skill
25
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill pulumi/agent-skills --skill pulumi-terraform-to-pulumi- SKILL.md3.1 KB
Overview
This skill migrates Terraform projects into Pulumi projects, translating HCL configurations and Terraform modules into Pulumi language code and state. It guides the end-to-end process: planning scope, producing a Pulumi state draft, installing matching providers, importing state, and iterating code until the Pulumi preview matches the original Terraform deployment. The goal is a reproducible Pulumi project and a clean pull request-ready codebase.
How this skill works
I inspect your Terraform directory and work with you to define the target Pulumi directory and language. I run the terraform-migrate plugin to produce a Pulumi state draft, install provider packages at the versions suggested by the plugin, import the generated state into a Pulumi stack, and then translate and adjust source code until pulumi preview shows no unexpected changes. I also help set up a Pulumi ESC environment if authorization or provider credentials are required for refresh operations.
When to use it
- You want to move infrastructure from Terraform to Pulumi while preserving state.
- You need a code translation from HCL (Terraform) to TypeScript, Python, Go, or C# Pulumi code.
- You must convert Terraform modules into Pulumi components for reuse.
- You need a reproducible imported Pulumi stack that matches existing Terraform-managed resources.
- You want guidance on provider version alignment and project dependency installation.
Best practices
- Plan scope up front: identify terraform_dir, pulumi_dir, target language, and whether to migrate state or only code.
- Create a fresh Pulumi project inside the checked-out repository (not /workspace) and ensure an empty project file and stack exist before importing state.
- Always run pulumi_up (or equivalent) to ensure initial stack metadata exists before running migration steps.
- Use the terraform-migrate plugin (terraform-migrate) to produce /tmp/pulumi-state.json and required-providers output; do not use pulumi convert.
- Install providers via the language package manager at the exact versions recommended (npm, pip, go get, dotnet) before importing state.
- Iterate on code until pulumi preview shows no diffs; accept minor provider/tag diffs only after validating they are safe.
Example use cases
- Migrate a multi-environment AWS Terraform setup to Pulumi TypeScript while preserving remote state.
- Translate a collection of Terraform modules into Pulumi components for internal reuse.
- Convert an existing Terraform-managed GCP project to Pulumi Python and import current resources into a new Pulumi stack.
- Upgrade a team from Terraform to Pulumi while keeping provider versions aligned to avoid drift.
- Set up an ESC environment to allow terraform-migrate refresh operations that require provider credentials.
FAQ
No. The plugin auto-installs when invoked; do not preinstall it. Run the migration command and let it manage installation.
What if terraform-migrate fails due to authorization during refresh?
Do not skip refresh. Work to provide credentials by linking or building a Pulumi ESC environment with required provider access so the refresh can succeed.
Should I use pulumi convert or pulumi package add terraform-module?
No. Use the terraform-migrate plugin as described. Avoid pulumi convert and pulumi package add terraform-module for this migration.