Pulumi Terraform To Pulumi
PulumiOfficialPublished by Pulumi
- Skill
- Workflow
- Cloud and DevOps
- Apache-2.0
- Low risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a systematic procedure for transitioning infrastructure-as-code projects from Terraform or OpenTofu to Pulumi. It emphasizes state preservation by utilizing the terraform-migrate plugin to map existing resources to a Pulumi stack. The process covers planning, state extraction, provider dependency management, and code translation to ensure the resulting Pulumi project matches the original infrastructure configuration.
What it does
- Extracts existing Terraform or OpenTofu state from local or remote backends.
- Generates a Pulumi state draft using the terraform-migrate plugin.
- Identifies and installs the necessary Pulumi provider dependencies.
- Imports translated state data into a new Pulumi stack.
- Guides the user through aligning source code with the imported state.
- Verifies the migration via Pulumi preview to ensure no unintended infrastructure changes.
When to use it
- When you need to migrate an existing Terraform or OpenTofu project to Pulumi.
- When you want to maintain your current infrastructure state while switching tools.
- When you need to translate HCL source code into a supported Pulumi language.
- When you are ready to adopt Pulumi for managing existing cloud resources.
Advantages
- Ensures state continuity by mapping existing resources to Pulumi.
- Provides a clear, step-by-step path for complex infrastructure migrations.
- Reduces manual effort by automating state translation and provider identification.
- Validates the migration through iterative previewing to ensure infrastructure stability.
Usage examples
- “Help me migrate my existing AWS Terraform project to Pulumi using TypeScript.”
- The agent will initiate the planning phase, confirm the project paths, and guide you through extracting the state and installing the required Pulumi AWS packages.
- “I have a Terraform state file in an S3 bucket. How do I move it to Pulumi?”
- The agent will instruct you on how to pull the remote state locally and use the migration plugin to import it into your new Pulumi stack.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/pulumi/pulumi-terraform-to-pulumi/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip pulumi-terraform-to-pulumi.zip -d .agents/skills
Documentation by Pulumi
Migrating from Terraform to Pulumi
Critical constraints — read before acting:
Do NOT run
pulumi convert— use the terraform-migrate plugin instead, which preserves state mapping.Do NOT run
pulumi package add terraform-module— this is for a different workflow.Do NOT create the Pulumi project under
/workspace— create it inside the checked-out repo.Replace
${terraform_dir}and${pulumi_dir}below with the actual paths confirmed with the user.
First establish scope and plan the migration by working out with the user:
where the Terraform sources are (
${terraform_dir})where the migrated Pulumi project lives (
${pulumi_dir})what is the target Pulumi language (such as TypeScript, Python, YAML)
whether migration aims to setup Pulumi stack states, or only translate source code
Confirm the plan with the user before proceeding.
Create a new Pulumi project in ${pulumi_dir} in the chosen language. Edit sources to be empty and not declare any
resources. Ensure a Pulumi stack exists.
You must run pulumi_up tool before proceeding to ensure initial stack state is written.
If no local .tfstate file exists in ${terraform_dir}, the state may be in a remote backend (S3, Pulumi Cloud, Terraform Cloud, etc.). Pull it before proceeding:
cd ${terraform_dir} && terraform state pull > terraform.tfstateThis works for all backends, including Pulumi Cloud. If terraform is not available, try tofu state pull instead.
Now produce a draft Pulumi state translation:
pulumi plugin run terraform-migrate -- stack \
--from ${terraform_dir} \
--to ${pulumi_dir} \
--out /tmp/pulumi-state.json \
--plugins /tmp/required-providers.jsonDo NOT install the plugin as it will auto-install as needed.
Sometimes terraform-migrate plugin fails because tofu refresh is not authorized. DO NOT skip this step. Work with the
user to find or build a Pulumi ESC environment that provides the necessary credentials so the command can succeed. If setting up an ESC environment is not feasible, inform the user that the migration cannot proceed automatically.
Read the generated /tmp/required-providers.json and install all these Pulumi providers into the new project,
respecting the suggested versions even if they downgrade an already installed provider. The file will contain records
such as [{"name":"aws","version":"7.12.0"}].
Install providers as project dependencies using the language-specific package manager (NOT pulumi plugin install,
which only downloads plugins without adding dependencies):
# TypeScript/JavaScript
npm install @pulumi/[email protected]
# Python
pip install pulumi_aws==7.12.0
# Go
go get github.com/pulumi/pulumi-aws/sdk/[email protected]
# C#
dotnet add package Pulumi.Aws --version 7.12.0Import the translated state draft (/tmp/pulumi-state.json) into the Pulumi stack:
pulumi stack import --file /tmp/pulumi-state.jsonTranslate source code to match both the Terraform source and the translated state. Aim for exact match. You can consult
the state draft /tmp/pulumi-state.json for Pulumi resource types and names to use.
Iterate on fixing the source code until pulumi_preview tool confirms that there are no changes to make and the diff
is empty or almost empty. Provider diffs or diffs on tags may be OK.
Offer the user to link an ESC environment to the stack so that each Pulumi stack can seamlessly have access to the provider credentials it needs.
When all looks good, create a Pull Request with the migrated source code.
Files
- ATTRIBUTION.mdAdded by AutoGineer886 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md3.9 KiB
- agents/openai.yaml218 B
- use_cases.yaml1.5 KiB
ATTRIBUTION.md
Attribution
This folder is an unmodified copy of the Agent Skill "pulumi-terraform-to-pulumi", distributed by AutoGineer (https://autogineer.com/agent-skills).
Commit: 82f222a529a499e8005a820000148cc5e28c934c
Published by: Pulumi (https://github.com/pulumi)
Publisher: Pulumi (https://github.com/pulumi)
Licence: Apache License 2.0 (https://github.com/pulumi/agent-skills/blob/82f222a529a499e8005a820000148cc5e28c934c/LICENSE)
Licence evidence: repository licence LICENSE
Retrieved: 2026-11-07
The skill's own files are unmodified copies. AutoGineer is not affiliated with or endorsed by the author or the publisher.
Files added by AutoGineer
ATTRIBUTION.md: this file, written by AutoGineer
LICENSE: copied from LICENSE
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Python, Needs Node.js
Security
What our scanner noticed· Low risk
- Instructions that use the network
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Pulumi
- Publisher
- Pulumi (Official)
- Source
- pulumi/agent-skills · migration/skills/pulumi-terraform-to-pulumi · commit 82f222a
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Pulumi or Pulumi.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download pulumi-terraform-to-pulumi.zip