code for article pfeilbr/cfn-diagram-playground
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
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
- mhlabs/cfn-diagram
- How (and Why) You Need To Start Generating Your Serverless Infrastructure Diagrams | Ready, Set, Cloud!
Twitter • Reddit