
Pulumi Cdk To Pulumi
Convert an existing AWS CDK Cloud Assembly (`cdk.out`) into a Pulumi YAML program without rewriting stacks by hand.
Overview
pulumi-cdk-to-pulumi is an agent skill most often used in Build (also Operate, Ship) that converts AWS CDK Cloud Assemblies to Pulumi YAML via the `cdk2pulumi` Pulumi tool plugin.
Install
npx skills add https://github.com/pulumi/agent-skills --skill pulumi-cdk-to-pulumiWhat is this skill?
- Runs via Pulumi CLI: `pulumi plugin run cdk2pulumi --` after `pulumi plugin install tool cdk2pulumi`
- Emits `Pulumi.yaml` plus `Pulumi.yaml.report.json` conversion report from a CDK Cloud Assembly
- Optional `--stacks`, `--stage`, and `--skip-custom` flags for partial or filtered conversions
- Documents cross-stack placeholders `${external.<stack>.<output>}` with `pulumi config set` follow-up
- Default prompt in interface: convert an AWS CDK application to Pulumi
- Outputs two artifacts: `Pulumi.yaml` and `Pulumi.yaml.report.json`
Adoption & trust: 530 installs on skills.sh; 56 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You already synthesized CDK but your team standardizes on Pulumi, and rewriting every stack manually is slow and error-prone.
Who is it for?
Indie teams mid-migration from AWS CDK to Pulumi who have a `cdk.out` assembly and need CLI-accurate conversion flags documented for the agent.
Skip if: Greenfield AWS apps with no CDK synth yet, non-AWS clouds, or builders who will not install Pulumi tool plugins.
When should I use this skill?
Use $pulumi-cdk-to-pulumi to convert an AWS CDK application to Pulumi when a CDK Cloud Assembly exists.
What do I get? / Deliverables
You produce a `Pulumi.yaml` program and conversion report, then resolve `${external.*}` config entries before `pulumi up`.
- Pulumi.yaml program
- Pulumi.yaml.report.json conversion report
- Documented external config keys for cross-stack references
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Migration starts when IaC is part of product delivery—canonical shelf is Build integrations because you are wiring cloud tooling into the repo. CDK-to-Pulumi is an integration between AWS CDK artifacts and the Pulumi CLI plugin, not app frontend or growth work.
Where it fits
After `cdk synth`, run conversion to drop Pulumi.yaml beside application code for unified agent deploy tasks.
Before first Pulumi prod update, map `${external.stack.output}` placeholders from the conversion report into `pulumi config`.
When retiring CDK pipelines, regenerate YAML from the latest assembly after stack splits or stage filters.
How it compares
Infrastructure migration assistant tied to Pulumi’s official `cdk2pulumi` plugin—not a generic Terraform import or hand-written stack generator.
Common Questions / FAQ
Who is pulumi-cdk-to-pulumi for?
Solo builders and small teams maintaining AWS CDK apps who need a documented, CLI-driven path to Pulumi YAML without bespoke translation scripts.
When should I use pulumi-cdk-to-pulumi?
In Build when integrating Pulumi into a CDK-born repo; in Ship or Operate when you are cutting over deploy pipelines and must reconcile cross-stack outputs via Pulumi config.
Is pulumi-cdk-to-pulumi safe to install?
Check the Security Audits panel on this page; the workflow executes Pulumi plugins against your `cdk.out` and may touch cloud-bound configuration—review outputs before applying prod stacks.
SKILL.md
READMESKILL.md - Pulumi Cdk To Pulumi
interface: display_name: "AWS CDK to Pulumi Migration" short_description: "Convert an AWS CDK application to Pulumi" default_prompt: "Use $pulumi-cdk-to-pulumi to convert an AWS CDK application to Pulumi." # Pulumi CDK Conversion Tool (`cdk2pulumi`) This tool plugin converts AWS CDK Cloud Assemblies to Pulumi YAML programs. ## Prerequisites - The tool must be installed: `pulumi plugin install tool cdk2pulumi` - All commands run through the Pulumi CLI using: `pulumi plugin run cdk2pulumi -- <args>` - A CDK Cloud Assembly (typically in `cdk.out` directory) must exist for conversion operations ## Commands ### 1. Convert CDK Assembly to Pulumi YAML Converts a CDK Cloud Assembly to a Pulumi YAML program (`Pulumi.yaml`) with an accompanying conversion report (`Pulumi.yaml.report.json`). **Basic conversion:** ```bash pulumi plugin run cdk2pulumi -- --assembly path/to/cdk.out ``` **Required flags:** - `--assembly`: Path to the synthesized CDK Cloud Assembly (typically `cdk.out` directory). By default this will convert the entire CDK application (i.e. all stacks and stages) **Optional flags:** - `--stacks`: Comma separated list of CDK Stacks to convert - `--stage`: Filter conversion to a specific CDK Stage - `--skip-custom`: Skip converting CDK custom resources **Important Notes:** - Cross-stack references in partially converted stacks become config placeholders: `${external.<stack>.<output>}` - Set these with: `pulumi config set external.<stack>.<output> <value>` before deployment - CDK custom resources are rewritten to `aws-native:cloudformation:CustomResourceEmulator` - The generated code will use the original CDK logical IDS. DO NOT update these otherwise automated import will FAIL ## Common Workflows ### Converting a CDK Application to Pulumi 1. **Synthesize the CDK app** to generate the Cloud Assembly: ```bash cdk synth ``` 2. **Convert the assembly** to Pulumi YAML: ```bash pulumi plugin run cdk2pulumi -- --assembly cdk.out ``` 3. **Review the conversion report** at `Pulumi.yaml.report.json` to identify any resources that didn't convert 1:1 4. **Set any required config** for cross-stack references: ```bash pulumi config set external.<stack>.<output> <value> ``` 5. **Convert the Pulumi YAML program** to the target language: ```bash pulumi convert --from yaml --generate-only --language typescript --out ./generated-program ``` > NOTE: after converting to another language you need to remove or rename the `Pulumi.yaml` file, otherwise it will still be treated as the main application 6. **Preview** the Pulumi program: ```bash pulumi preview ``` ## Tips for Running - Always use `--` to separate Pulumi CLI arguments from plugin arguments - The `--assembly` flag expects a directory path (typically `cdk.out`), not a file - When converting specific stacks, use comma-separated names without spaces: `--stacks Stack1,Stack2` - For multi-stage CDK apps, use `--stage <name>` to target nested assemblies - The tool outputs to `Pulumi.yaml` by default; use `--out` to specify a different location # Pulumi CDK Importer Tool This tool assists migrating CDK-managed infrastructure to Pulumi. It imports existing AWS resources from CloudFormation stacks into Pulumi state. ## Installation ```shell pulumi plugin install tool cdk-importer ``` ## Credentials Running the `cdk-importer` tool requires credentials loaded via Pulumi ESC. - If the user has already provided an ESC environment, use it. - If no ESC environment is specified, **ask the user which ESC environment to use** before proceeding with using the tool. You MUST confirm the AWS region with the user. The results may be incorrect if ran with the wrong AWS Region. The region can be set with the `AWS_REGION` environment variable ## Commands ### program import Import into the selected Pulumi stack using an existing generated Pulumi program. ```shell pulumi plugin run cdk-importer -- program import \ --