CFN Diagram

learn cfn-diagram

CLI tool to visualise CloudFormation/SAM/CDK templates as diagrams.

Usage

# install
npm i -g @mhlabs/cfn-diagram

# draw.io render
cfn-dia draw.io --template-file CloudFrontS3WebsiteCdkStack.template.yaml \
    --output-file CloudFrontS3WebsiteCdkStack.drawio

# html render
cfn-dia html --template-file CloudFrontS3WebsiteCdkStack.template.yaml \
    --output-path CloudFrontS3WebsiteCdkStack-html

Screenshots

draw.io view in vscode

draw.io view in vscode - hover resource for details

html view

Notes

  • good starting point. generate draw.io to get all resources and icons, then modify from there.
  • allows for filtering by resource types to eliminate resources that may not be needed.
  • works by importing cfn template into CDK. CDK allows to treat as graph for traversal and inspection

Resources