AWS IaC Converter
Convert AWS Infrastructure as Code between CloudFormation, CDK (TypeScript/Python), and Terraform with a structured, interactive workflow.
When to Use
Use when the user wants to convert or migrate AWS IaC between CloudFormation, CDK, or Terraform (see description).
Supported Conversions
| Source |
Target Options |
| CloudFormation |
CDK (TypeScript/Python), Terraform |
| CDK |
CloudFormation, Terraform |
| Terraform |
CloudFormation, CDK (TypeScript/Python) |
MCP Server Integration
This skill leverages MCP servers for accurate, up-to-date conversions:
| Server |
Purpose |
| AWS IaC MCP Server |
CloudFormation validation, CDK docs, compliance checking |
| Terraform MCP Server |
Terraform validation, security scanning, provider docs |
| AWS Documentation MCP |
Service feature verification, API reference |
Before Converting
- Always verify resource properties using MCP tools to ensure accurate mapping
- If MCP tools are unavailable, guide user to configure them via the
aws-mcp-setup skill (auto-loaded as dependency)
Why this skill keeps its own planning and verification
The orchestrator has a planner and a verifier, but they are generic (technical plans; “does work match plan?”). This skill keeps conversion-specific steps:
- Planning (Phases 1–4) — Repo analysis, IaC detection, target selection, and the conversion plan (resource mapping, target output path, conversion patterns, parameters→variables) are IaC-conversion concerns. The orchestrator’s planner does not produce conversion plans. The skill produces the plan and then hands it to the orchestrator; the orchestrator skips its planner and runs only the implementer.
- Verification & reporting (Phases 6–7) — Running
validate-conversion.sh, the “resolve lint / security report-only” policy, and generating CONVERSION-REPORT.md (source-to-target mapping, security findings) are conversion-specific. The orchestrator’s verifier does not run these. After the implementer completes, this skill runs Phase 6–7.
So: only implementation (Phase 5) is delegated to the orchestrator’s implementer. Planning and verification stay in the skill.
Workflow
Phase 1: Repository Input
- Ask the user for the source code repository URL.
- Do NOT proceed until the user provides the URL.
- Accept: GitHub URL, GitLab URL, Bitbucket URL, or local path.
- If the URL is a remote repository, clone it into a temporary working directory.
- If the URL is a local path, confirm it exists and is accessible.
Phase 2: Analysis & Detection
Analyze the repository to identify all AWS IaC code. Run the analysis script:
bash .cursor/skills/aws-iac-converter/scripts/analyze-repo.sh <repo-path>
Identify the IaC type(s) found. Detection rules: references/analysis-guide.md.
Present findings to the user:
- IaC type detected (CloudFormation, CDK, Terraform, or mixed)
- Files and directories containing IaC code
- AWS resources identified
- Any non-IaC code detected (application code, CI/CD, etc.)
Phase 3: Target Selection
- Ask the user for the target IaC type.
- Do NOT proceed until the user provides the target type.
- The target type must be different from the source type.
- If CDK is selected, ask for the language preference (TypeScript or Python).
- Validate the selection and confirm with the user.
Phase 4: Conversion Planning
Create a detailed conversion plan covering:
- Target output path — Directory where converted code will be written (e.g.
<workspace>/converted-terraform). Required so the orchestrator’s implementer and Phase 6/7 use the same path.
- Resource-by-resource mapping from source to target
- Parameter/variable conversion strategy
- Output/export handling
- State management considerations (especially for Terraform)
- Dependencies and ordering
- Resources that cannot be directly converted (with workarounds)
- Conversion patterns used: references/conversion-patterns.md
Present the plan to the user for review.
- Show a summary table of resources and their conversion status
- Highlight any risks, limitations, or manual steps required
- Do NOT proceed until the user approves the plan.
- Incorporate any user feedback into the plan before proceeding.
Phase 5: Implementation
- Delegate implementation to the orchestrator agent — Do not implement in-place. Invoke the orchestrator agent with:
- Input: The approved conversion plan (from Phase 4), including the target output path; the target IaC stack/scope (e.g. Terraform, CDK TypeScript, CloudFormation); and the source repo path.
- Orchestrator: Skip the orchestrator’s planner. Have the orchestrator run its implementer subagent(s) for the target IaC stack. Implementer writes converted code to the target output path from the plan, using references/conversion-patterns.md and MCP for property mappings, and generates dependency files (
package.json, requirements.txt, versions.tf, etc.).
- Resume: After the implementer(s) complete, resume this skill with the target output path (from the plan) and run Phase 6 (Verification) and Phase 7 (Reporting).
Phase 6: Verification
Verify the converted code at the target output path (from the plan; where the orchestrator’s implementer wrote output). Run:
bash .cursor/skills/aws-iac-converter/scripts/validate-conversion.sh <target-path> <target-type>
Use <target-path> = target output path from the conversion plan.
Resolve all lint/validation failures (syntax, structure, formatting, cfn-lint, terraform validate/fmt, cdk synth/build). Do not resolve security-specific findings (Checkov, cfn-guard, etc.) — run those scans and record results for the report only (may be intentional from source). See references/verification-checklist.md.
Phase 7: Reporting
Generate a conversion report at <target-output-path>/CONVERSION-REPORT.md (same path used in Phase 6).
- Report template: references/report-template.md
- Include:
- Source-to-target resource mapping table
- Successfully converted resources
- Partially converted resources (with manual steps needed)
- Resources that could not be converted (with reasons)
- Validation results (syntax, structure)
- Security scan findings (report only; do not mark as issues to fix)
- Recommendations and next steps
Summarize to the user:
- Total resources converted vs. total in source
- Any resources requiring manual attention
- Location of converted code and report
- Suggested next steps (testing, deployment, etc.)
Output Layout
The target output path (agreed in the conversion plan) is where the orchestrator’s implementer writes converted code. After Phase 6–7 it will contain:
<target-output-path>/
├── <converted IaC files> # Written by orchestrator's implementer
├── <dependency files> # package.json, requirements.txt, versions.tf, etc.
├── README.md # Generated README for the converted project
└── CONVERSION-REPORT.md # Added by this skill in Phase 7
Key Principles
- Wait for user input at checkpoints (repo URL, target type, plan approval). Do not proceed until provided.
- Implementation is only via the orchestrator’s implementer; this skill owns planning (Phases 1–4), handoff (Phase 5), verification (Phase 6), and reporting (Phase 7).
- The conversion plan must include a target output path so the implementer and this skill use the same directory for output and verification.
- Resolve lint/validation in Phase 6; record security findings only. Generate a conversion report that maps every source resource to target (or documents unconvertible ones).
References: analysis-guide · conversion-patterns · report-template · verification-checklist
1---2name: aws-iac-converter-23description: Convert AWS Infrastructure as Code between CloudFormation, CDK (TypeScript/Python), and Terraform. Use when converting IaC code from one format to another, migrating infrastructure definitions, or when the user mentions IaC conversion, CloudFormation to Terraform, CDK to CloudFormation, Terraform to CDK, or any AWS IaC migration.4---56# AWS IaC Converter78Convert AWS Infrastructure as Code between CloudFormation, CDK (TypeScript/Python), and Terraform with a structured, interactive workflow.910## When to Use1112Use when the user wants to convert or migrate AWS IaC between CloudFormation, CDK, or Terraform (see description).1314## Supported Conversions1516| Source | Target Options |17| ----------------- | ---------------------------------------- |18| **CloudFormation** | CDK (TypeScript/Python), Terraform |19| **CDK** | CloudFormation, Terraform |20| **Terraform** | CloudFormation, CDK (TypeScript/Python) |2122## MCP Server Integration2324This skill leverages MCP servers for accurate, up-to-date conversions:2526| Server | Purpose |27| ----------------------------------- | ------------------------------------------------------------ |28| **AWS IaC MCP Server** | CloudFormation validation, CDK docs, compliance checking |29| **Terraform MCP Server** | Terraform validation, security scanning, provider docs |30| **AWS Documentation MCP** | Service feature verification, API reference |3132### Before Converting33341. **Always verify** resource properties using MCP tools to ensure accurate mapping352. If MCP tools are unavailable, guide user to configure them via the `aws-mcp-setup` skill (auto-loaded as dependency)3637### Why this skill keeps its own planning and verification3839The [orchestrator](.cursor/agents/orchestrator.md) has a **planner** and a **verifier**, but they are generic (technical plans; “does work match plan?”). This skill keeps **conversion-specific** steps:4041- **Planning (Phases 1–4)** — Repo analysis, IaC detection, target selection, and the **conversion plan** (resource mapping, target output path, conversion patterns, parameters→variables) are IaC-conversion concerns. The orchestrator’s planner does not produce conversion plans. The skill produces the plan and then hands it to the orchestrator; the orchestrator **skips its planner** and runs only the **implementer**.42- **Verification & reporting (Phases 6–7)** — Running `validate-conversion.sh`, the “resolve lint / security report-only” policy, and generating `CONVERSION-REPORT.md` (source-to-target mapping, security findings) are conversion-specific. The orchestrator’s verifier does not run these. After the implementer completes, **this skill** runs Phase 6–7.4344So: **only implementation (Phase 5)** is delegated to the orchestrator’s implementer. Planning and verification stay in the skill.4546## Workflow4748### Phase 1: Repository Input49501. **Ask the user** for the source code repository URL.51 - **Do NOT proceed** until the user provides the URL.52 - Accept: GitHub URL, GitLab URL, Bitbucket URL, or local path.532. If the URL is a remote repository, clone it into a temporary working directory.543. If the URL is a local path, confirm it exists and is accessible.5556### Phase 2: Analysis & Detection57584. **Analyze the repository** to identify all AWS IaC code. Run the analysis script:5960 ```bash61 bash .cursor/skills/aws-iac-converter/scripts/analyze-repo.sh <repo-path>62 ```63645. **Identify the IaC type(s)** found. Detection rules: [references/analysis-guide.md](references/analysis-guide.md).656. **Present findings** to the user:66 - IaC type detected (CloudFormation, CDK, Terraform, or mixed)67 - Files and directories containing IaC code68 - AWS resources identified69 - Any non-IaC code detected (application code, CI/CD, etc.)7071### Phase 3: Target Selection72737. **Ask the user** for the target IaC type.74 - **Do NOT proceed** until the user provides the target type.75 - The target type **must be different** from the source type.76 - If CDK is selected, ask for the language preference (TypeScript or Python).77 - Validate the selection and confirm with the user.7879### Phase 4: Conversion Planning80818. **Create a detailed conversion plan** covering:82 - **Target output path** — Directory where converted code will be written (e.g. `<workspace>/converted-terraform`). Required so the orchestrator’s implementer and Phase 6/7 use the same path.83 - Resource-by-resource mapping from source to target84 - Parameter/variable conversion strategy85 - Output/export handling86 - State management considerations (especially for Terraform)87 - Dependencies and ordering88 - Resources that **cannot** be directly converted (with workarounds)89 - Conversion patterns used: [references/conversion-patterns.md](references/conversion-patterns.md)90919. **Present the plan** to the user for review.92 - Show a summary table of resources and their conversion status93 - Highlight any risks, limitations, or manual steps required94 - **Do NOT proceed** until the user approves the plan.95 - Incorporate any user feedback into the plan before proceeding.9697### Phase 5: Implementation989910. **Delegate implementation to the orchestrator agent** — Do not implement in-place. Invoke the [orchestrator agent](.cursor/agents/orchestrator.md) with:100 - **Input**: The **approved conversion plan** (from Phase 4), including the **target output path**; the **target IaC stack/scope** (e.g. Terraform, CDK TypeScript, CloudFormation); and the **source repo path**.101 - **Orchestrator**: Skip the orchestrator’s planner. Have the orchestrator run its **implementer** subagent(s) for the target IaC stack. Implementer writes converted code to the **target output path** from the plan, using [references/conversion-patterns.md](references/conversion-patterns.md) and MCP for property mappings, and generates dependency files (`package.json`, `requirements.txt`, `versions.tf`, etc.).102 - **Resume**: After the implementer(s) complete, **resume this skill** with the **target output path** (from the plan) and run Phase 6 (Verification) and Phase 7 (Reporting).103104### Phase 6: Verification10510611. **Verify** the converted code at the **target output path** (from the plan; where the orchestrator’s implementer wrote output). Run:107108 ```bash109 bash .cursor/skills/aws-iac-converter/scripts/validate-conversion.sh <target-path> <target-type>110 ```111 Use `<target-path>` = target output path from the conversion plan.11211312. **Resolve** all lint/validation failures (syntax, structure, formatting, cfn-lint, terraform validate/fmt, cdk synth/build). **Do not resolve** security-specific findings (Checkov, cfn-guard, etc.) — run those scans and **record results for the report only** (may be intentional from source). See [references/verification-checklist.md](references/verification-checklist.md).114115### Phase 7: Reporting11611713. **Generate a conversion report** at `<target-output-path>/CONVERSION-REPORT.md` (same path used in Phase 6).118 - Report template: [references/report-template.md](references/report-template.md)119 - Include:120 - Source-to-target resource mapping table121 - Successfully converted resources122 - Partially converted resources (with manual steps needed)123 - Resources that could not be converted (with reasons)124 - Validation results (syntax, structure)125 - Security scan findings (report only; do not mark as issues to fix)126 - Recommendations and next steps12712814. **Summarize to the user**:129 - Total resources converted vs. total in source130 - Any resources requiring manual attention131 - Location of converted code and report132 - Suggested next steps (testing, deployment, etc.)133134## Output Layout135136The **target output path** (agreed in the conversion plan) is where the orchestrator’s implementer writes converted code. After Phase 6–7 it will contain:137138```139<target-output-path>/140├── <converted IaC files> # Written by orchestrator's implementer141├── <dependency files> # package.json, requirements.txt, versions.tf, etc.142├── README.md # Generated README for the converted project143└── CONVERSION-REPORT.md # Added by this skill in Phase 7144```145146## Key Principles147148- Wait for user input at checkpoints (repo URL, target type, plan approval). Do not proceed until provided.149- Implementation is **only** via the orchestrator’s implementer; this skill owns planning (Phases 1–4), handoff (Phase 5), verification (Phase 6), and reporting (Phase 7).150- The conversion plan must include a **target output path** so the implementer and this skill use the same directory for output and verification.151- Resolve lint/validation in Phase 6; record security findings only. Generate a conversion report that maps every source resource to target (or documents unconvertible ones).152153**References:** [analysis-guide](references/analysis-guide.md) · [conversion-patterns](references/conversion-patterns.md) · [report-template](references/report-template.md) · [verification-checklist](references/verification-checklist.md)