InfraSketch now supports AWS CDK. Run cdk synth, paste the JSON output into the CDK tab, and get a full architecture diagram in seconds — VPC containment, subnet lanes, resource connections, official AWS icons. No login, no credentials, everything in your browser.
Try it now Paste your
cdk synthoutput and see the diagram instantly. Open InfraSketch →
Why CDK needs a diagram tool
CDK is increasingly the default way teams write AWS infrastructure — TypeScript, Python, or Go code that compiles down to CloudFormation. The abstractions are great for development velocity, but they create a visibility problem: when something goes wrong, or when you need to explain the architecture to someone outside your team, the source code is not the right artifact to share.
The CloudFormation console shows you a stack but won't visualize containment. The CDK tree view shows construct hierarchy, not network topology. There's no built-in way to go from a CDK app to a clean architecture diagram without manually drawing one.
InfraSketch fills that gap. One command, paste, done.
How to get your CDK synth output
cdk synth | pbcopy # macOS — copies to clipboard
cdk synth > template.json # save to file
Then open infrasketch.cloud, click the CDK tab, paste, and click Generate Diagram.
Tip: If your app has multiple stacks, use cdk synth MyStack to synthesize a specific stack, or paste each stack's output separately to diagram them individually.
How it works under the hood
CDK compiles to CloudFormation JSON. InfraSketch's CDK tab runs the same parser as the CloudFormation tab — it reads the Resources object, maps each Type to a visual category, and infers topology from Ref and Fn::GetAtt references between resources.
CDK logical IDs look different from hand-written CloudFormation — CDK generates names like VPCB9E5F0B4 and EKSCluster9EE0221C — but the diagram labels use the resource type and truncated logical ID, making it easy to identify resources without needing the CDK source code in front of you.
What gets visualized
VPC containment
Resources with VpcId: { Ref: VPC } are drawn inside the VPC box. CDK's ec2.Vpc construct generates this automatically.
Subnet placement
Public and private subnet lanes from CDK's SubnetSelection — SubnetIds in the synthesized JSON places resources in the right lane.
Connection arrows
Every Fn::GetAtt between supported resources becomes a directed arrow — Lambda → IAM Role, ECS Service → ALB Target Group, etc.
Zone grouping
Internet zone (IGW, CloudFront), messaging zone (SQS, SNS), data zone (RDS, ElastiCache, S3) — all inferred automatically from resource type.
Supported CDK constructs (L1 / Cfn*)
Any CDK L1 construct (prefixed Cfn) maps directly to a CloudFormation resource type and is fully supported. Common L2 constructs synthesize to the same underlying types:
-
ec2.Vpc→AWS::EC2::VPC+ subnets + IGW + NAT gateways -
eks.Cluster→AWS::EKS::Cluster+ node groups + IAM roles -
ecs.FargateService→AWS::ECS::Service+ task definition -
lambda.Function→AWS::Lambda::Function+ IAM role -
rds.DatabaseInstance→AWS::RDS::DBInstance+ subnet group -
elasticache.CfnReplicationGroup→AWS::ElastiCache::ReplicationGroup -
s3.Bucket→AWS::S3::Bucket -
sqs.Queue→AWS::SQS::Queue -
sns.Topic→AWS::SNS::Topic -
elbv2.ApplicationLoadBalancer→AWS::ElasticLoadBalancingV2::LoadBalancer -
cloudfront.Distribution→AWS::CloudFront::Distribution -
kms.Key→AWS::KMS::Key -
iam.Role→AWS::IAM::Role -
wafv2.CfnWebACL→AWS::WAFv2::WebACL -
route53.HostedZone→AWS::Route53::HostedZone
Use cases
-
Code reviews — run
cdk synthon a PR branch and paste the output to see what the architecture change looks like visually - Onboarding — share a diagram link with new team members instead of asking them to read CDK TypeScript they've never seen
- Documentation — export as PNG or SVG and embed in Confluence, Notion, or your wiki
- Architecture reviews — export as draw.io XML to get a fully editable diagram for your design doc
- Drift detection — synthesize before and after a change and compare diagrams side by side
Works with CDK for Terraform too
CDK for Terraform (CDKTF) can synthesize Terraform JSON. If you're using CDKTF, use the Terraform tab and paste the synthesized JSON — InfraSketch's plan JSON parser handles it directly.
Generate your CDK diagram now Run
cdk synth | pbcopy, paste into the CDK tab, click Generate. Free, no login, nothing leaves your browser. Open InfraSketch →
Top comments (0)