pulumi-terraform-to-pulumi by pulumi/agent-skills
npx skills add https://github.com/pulumi/agent-skills --skill pulumi-terraform-to-pulumi首先,通过与用户协作来确定迁移的范围并制定计划:
${terraform_dir})${pulumi_dir})在继续之前,与用户确认计划。
在所选语言中,于 ${pulumi_dir} 创建一个新的 Pulumi 项目。编辑源代码使其为空且不声明任何资源。确保存在一个 Pulumi 堆栈。
在继续之前,您必须运行 pulumi_up 工具以确保写入初始堆栈状态。
现在生成一个 Pulumi 状态翻译草案:
pulumi plugin run terraform-migrate -- stack \
--from ${terraform_dir} \
--to ${pulumi_dir} \
--out /tmp/pulumi-state.json \
--plugins /tmp/required-providers.json
请勿安装插件,因为它会在需要时自动安装。
有时 terraform-migrate 插件会失败,因为 tofu refresh 未被授权。请勿跳过此步骤。与用户协作,寻找或构建一个 Pulumi ESC 环境来运行该命令,使其成功。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
读取生成的 /tmp/required-providers.json 文件,并将所有这些 Pulumi 提供程序安装到新项目中,遵循建议的版本,即使它会降级已安装的提供程序。该文件将包含类似 [{"name":"aws","version":"7.12.0"}] 的记录。
使用特定语言的包管理器安装提供程序作为项目依赖项(不要使用 pulumi plugin install,该命令仅下载插件而不添加依赖项):
# TypeScript/JavaScript
npm install @pulumi/aws@7.12.0
# Python
pip install pulumi_aws==7.12.0
# Go
go get github.com/pulumi/pulumi-aws/sdk/v7@v7.12.0
# C#
dotnet add package Pulumi.Aws --version 7.12.0
将翻译的状态草案(/tmp/pulumi-state.json)导入到 Pulumi 堆栈中:
pulumi stack import --file /tmp/pulumi-state.json
翻译源代码以同时匹配 Terraform 源代码和翻译后的状态。目标是完全匹配。您可以参考状态草案 /tmp/pulumi-state.json 来获取要使用的 Pulumi 资源类型和名称。
反复修复源代码,直到 pulumi_preview 工具确认无需进行任何更改,并且差异为空或几乎为空。提供程序差异或标签上的差异可能是可以接受的。
向用户提议将 ESC 环境链接到堆栈,以便每个 Pulumi 堆栈都能无缝访问其所需的提供程序凭据。
当一切看起来都正常后,创建一个包含迁移后源代码的 Pull Request。
重要提示:
pulumi convert,而是使用 terraform-migrate 插件pulumi package add terraform-module每周安装次数
260
代码仓库
GitHub 星标数
30
首次出现
2026年1月28日
安全审计
安装于
opencode226
codex223
github-copilot223
gemini-cli217
amp215
kimi-cli214
First establish scope and plan the migration by working out with the user:
${terraform_dir})${pulumi_dir})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.
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.json
Do 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 to run the command in to make it succeed.
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/aws@7.12.0
# Python
pip install pulumi_aws==7.12.0
# Go
go get github.com/pulumi/pulumi-aws/sdk/v7@v7.12.0
# C#
dotnet add package Pulumi.Aws --version 7.12.0
Import the translated state draft (/tmp/pulumi-state.json) into the Pulumi stack:
pulumi stack import --file /tmp/pulumi-state.json
Translate 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.
IMPORTANT:
pulumi convert, instead use the terraform-migrate pluginpulumi package add terraform-moduleWeekly Installs
260
Repository
GitHub Stars
30
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode226
codex223
github-copilot223
gemini-cli217
amp215
kimi-cli214
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
102,600 周安装
ADK 可观测性指南:Google AI Agent 分布式追踪、日志记录与分析
1,400 周安装
ADK 部署指南:Agent Engine、Cloud Run、GKE 部署决策与快速部署教程
1,500 周安装
Google ADK 速查表 - Python ADK SDK API 参考与开发指南
1,500 周安装
GSAP插件使用指南:ScrollTo、Flip、Draggable等核心插件详解与注册教程
1,700 周安装
ADK 评估指南:AI 智能体评估、测试与优化全流程详解 | Google ADK 开发
1,400 周安装
统一语言工具:自动提取领域术语,创建规范术语表,提升团队沟通效率
1,600 周安装