cdk-from-cfn
TypeScript icon, indicating that this package has built-in type declarations

0.212.0 • Public • Published

cdk-from-cfn

cdk-from-cfn is a command-line tool that converts AWS CloudFormation templates into AWS CDK code. It supports multiple programming languages including TypeScript, Python, Java, Go, and C#.

Installation

$ cargo install cdk-from-cfn

Usage

$ cdk-from-cfn [INPUT] [OUTPUT] --language <LANGUAGE> --stack-name <STACK_NAME>
  • INPUT is the input file path (STDIN by default).
  • OUTPUT is the output file path; if not specified, output will be printed on your command line (STDOUT by default).

Node.js Module Usage

cdk-from-cfn leverages WebAssembly (WASM) bindings to provide a cross-platform npm module, which exposes apis to be used in Node.js projects. Simply take a dependency on cdk-from-cfn in your package.json and utilize it as you would a normal module. i.e.

import * as cdk_from_cfn from 'cdk-from-cfn';

// get supported languages
cdk_from_cfn.supported_languages();

// transmute cfn template into cdk app
cdk_from_cfn.transmute(template, language, stackName)

Language and Feature support

Name Enabled by default Description
typescript ✔️ Enables support for TypeScript output
golang ✔️ Enables support for Go output
java ✔️ Enables support for Java output
Python ✔️ Enables support for Python output
csharp ✔️ Enables support for C# output

You can enable experimental languages (not enabled by default) by enabling the relevant feature:

$ cargo build --release --features=<feature-name>
Finished release [optimized] target(s) in 0.17s

If you want to disable on-by-default languages, you can pass --no-default-features:

$ cargo build --release --no-default-features --features=golang
Finished release [optimized] target(s) in 0.17s

Implemented

  • [x] Fn::FindInMap
  • [x] Fn::Join
  • [x] Fn::Sub
  • [x] Ref
  • [x] Fn::And
  • [x] Fn::Equals
  • [x] Fn::If
  • [x] Fn::Not
  • [x] Fn::Or
  • [x] Fn::GetAtt
  • [x] Fn::Base64 support
  • [x] Fn::ImportValue support
  • [x] Fn::Select support
  • [x] Resource ordering based on dependencies
  • [x] Conditions are emitted in ts but not attached to resource conditions
  • [x] Metadata emission for updates to asgs / lambda functions.
  • [x] Emission of outputs / exports
  • [x] Fn::GetAZs support
  • [x] Adding depends-on, and ordering based on it too.
  • [x] Deletion policy
  • [x] Fn::Cidr support

Remaining

There are known unsupported features. Working on them in priority order:

  • [ ] Create policy
  • [ ] ssm metadata references
  • [ ] secretsmanager references

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.212.062latest

Version History

VersionDownloads (Last 7 Days)Published
0.212.062
0.211.089
0.210.01,031
0.209.07
0.208.06
0.207.06
0.206.01,355
0.205.09,954
0.204.07
0.203.0147
0.202.01
0.201.02
0.200.03
0.199.03
0.198.00
0.197.01
0.196.00
0.195.04
0.194.00
0.193.010,815
0.192.01
0.191.02
0.190.01
0.189.00
0.188.01
0.187.00
0.186.01
0.185.00
0.184.00
0.183.00
0.182.01
0.181.00
0.180.00
0.179.02
0.178.00
0.177.01
0.175.00
0.174.00
0.173.00
0.172.00
0.171.01
0.170.00
0.169.01
0.168.00
0.167.00
0.166.01
0.165.00
0.164.00
0.163.01
0.162.131,654
0.162.03,395
0.161.00
0.160.00
0.159.02
0.158.00
0.157.00
0.156.00
0.155.00
0.154.00
0.153.00
0.152.01
0.151.00
0.150.029
0.149.01
0.148.00
0.147.00
0.146.00
0.145.00
0.144.00
0.143.00
0.142.01
0.141.02
0.140.00
0.139.00
0.138.00
0.137.00
0.136.00
0.135.00
0.134.01
0.133.00
0.132.00
0.131.01
0.130.00
0.129.02
0.128.00
0.127.00
0.126.01
0.125.01
0.122.00
0.121.00
0.120.00
0.119.00
0.118.00
0.117.01
0.116.00
0.115.01
0.114.01
0.113.00
0.112.00
0.111.00
0.110.00
0.109.01
0.108.01
0.107.01
0.106.00
0.105.01
0.104.01
0.103.02
0.102.02
0.101.00
0.100.00
0.99.00
0.98.01
0.97.00
0.96.01
0.95.00
0.94.00
0.93.01
0.92.00
0.91.00
0.90.01
0.89.01
0.88.01
0.87.00
0.86.01
0.85.00
0.84.00
0.83.01,731
0.82.01
0.81.01
0.80.00
0.79.01
0.78.01
0.77.00
0.76.01
0.75.01
0.74.00
0.73.00
0.72.00
0.71.00
0.70.00
0.69.01
0.67.04
0.66.00
0.65.00
0.64.00
0.63.00
0.62.00
0.61.01
0.60.01
0.59.00
0.58.00
0.57.00
0.56.00
0.55.01
0.54.01
0.53.01
0.52.01
0.51.00
0.50.01
0.49.00
0.48.01
0.47.0113
0.46.01
0.45.00
0.44.036
0.43.00
0.42.00
0.41.00
0.40.00
0.39.00
0.38.01
0.37.00
0.36.00
0.35.01
0.33.00
0.32.01
0.31.01
0.30.00
0.27.00
0.26.015
0.25.00
0.24.01
0.23.01
0.22.00
0.21.00
0.19.00
0.18.00
0.17.00
0.16.01
0.15.01
0.14.00
0.13.00
0.12.00
0.11.01
0.10.01
0.9.01
0.3.00

Package Sidebar

Install

npm i cdk-from-cfn

Weekly Downloads

60,543

Version

0.212.0

License

MIT OR Apache-2.0

Unpacked Size

4.3 MB

Total Files

5

Last publish

Collaborators

  • cdklabs-automation