cloudtools / troposphere

troposphere - Python library to create AWS CloudFormation descriptions
BSD 2-Clause "Simplified" License
4.93k stars 1.45k forks source link

Add support for Diagrams #2118

Closed ggiallo28 closed 1 year ago

ggiallo28 commented 1 year ago

It would be nice to have a .to_diagram() option.

Diagrams allow you to draw the architecture of the cloud system in Python code. Here is the official site: https://diagrams.mingrammer.com/

Do you know if anyone is interested?

PatMyron commented 1 year ago

Troposphere outputs CloudFormation, and there are existing diagram solutions for CloudFormation, so I recommend one of those solutions is used rather than re-writing duplicate code: https://github.com/aws/aws-cdk/issues/301#issuecomment-680421176 https://github.com/aws-cloudformation/cfn-lint/pull/1411 https://github.com/aws-cloudformation/cfn-lint-visual-studio-code/pull/106 https://marketplace.visualstudio.com/items?itemName=kddejong.vscode-cfn-lint

ggiallo28 commented 1 year ago

I am familiar with all of these tools. I think the result is horrible, and cfn-lint is not "Diagrams as Code". I was thinking of something like this: https://github.com/pistazie/cdk-dia, without forcing people to use CDK.

PatMyron commented 1 year ago

cfn-lint -g generates diagrams from CloudFormation code (which Troposphere generates) If you think that's horrible because cfn-lint's diagrams do not have AWS product icons, I linked cfn-diagram which has them, but the icon mapping doesn't look maintained for new AWS products, nor do I expect anyone to maintain a mapping