MCPcopy Index your code
hub / github.com/cdklabs/cdk-from-cfn

github.com/cdklabs/cdk-from-cfn @v0.162.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.162.0 ↗ · + Follow
738 symbols 1,799 edges 176 files 29 documented · 4% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

cdk-from-cfn

In a world where people want to use the full extent of the cdk, there was no product that would transform all your JSON/YAML into beautiful typescript...until now.

cdk-from-cfn will take your JSON/YAML and output the equivalent typescript.

User Guide

$ cargo build --release
$ ./target/release/cdk-from-cfn [INPUT] [OUTPUT]
  • 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).

Cargo Features

Name Enabled by default Description
typescript :heavy_check_mark: Enables support for TypeScript output
golang :heavy_check_mark: Enables support for Go output
java :heavy_check_mark: Enables support for Java output
Python :heavy_check_mark: Enables support for Python output
csharp :heavy_check_mark: 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

Extension points exported contracts — how you extend this code

Synthesizer (Interface)
(no doc) [5 implementers]
src/synthesizer/mod.rs
CdkAppCodeWriter (Interface)
(no doc) [5 implementers]
tests/cdk_app_code_writers.rs
PropertyBag (Interface)
(no doc) [3 implementers]
src/cdk/schema.rs
JsonPropsStackProps (Interface)
(no doc)
tests/end-to-end/resource_w_json_type_properties/typescript/stack.ts
Inspectable (Interface)
(no doc) [4 implementers]
src/synthesizer/golang/mod.rs
SimpleStackProps (Interface)
(no doc)
tests/end-to-end/simple/typescript/stack.ts
GolangEmitter (Interface)
(no doc) [3 implementers]
src/synthesizer/golang/mod.rs
BucketStackProps (Interface)
(no doc)
tests/end-to-end/bucket/typescript/stack.ts

Core symbols most depended-on inside this repo

into
called by 387
src/parser/condition/mod.rs
text
called by 308
src/code/mod.rs
line
called by 260
src/code/mod.rs
indent_with_options
called by 94
src/code/mod.rs
newline
called by 67
src/code/mod.rs
clone
called by 53
src/cdk/schema.rs
section
called by 35
src/code/mod.rs
unwrap
called by 34
src/parser/condition/mod.rs

Shape

Method 260
Function 225
Class 174
Struct 28
Enum 27
Interface 24

Languages

Rust64%
C#9%
Java9%
TypeScript8%
Go6%
Python4%

Modules by API surface

src/cdk/schema.rs33 symbols
src/synthesizer/java/mod.rs30 symbols
src/synthesizer/csharp/tests.rs28 symbols
src/parser/condition/tests.rs22 symbols
src/parser/condition/mod.rs22 symbols
src/parser/resource/mod.rs21 symbols
src/synthesizer/typescript/mod.rs20 symbols
src/ir/resources/mod.rs20 symbols
src/synthesizer/python/mod.rs19 symbols
src/synthesizer/golang/mod.rs19 symbols
src/ir/resources/tests.rs19 symbols
src/code/mod.rs17 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add cdk-from-cfn \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact