Hi Everyone. Our team has recently started using s...
# help
d
Hi Everyone. Our team has recently started using serverless-stack. I was wondering, is there any good automated tool to visualize the infrastructure generated? I’d love to have a nice diagram for our documentation which is always up to date.
n
I don’t exactly have the answer but seeing as severless-stack is just generating Cloud Formation templates I think the question to ask is there any tool that will visualize Cloud Formation?
t
There are automatic tools, the problem is the underlying infrastructure is pretty complex and the diagrams usually have 90% too much information
I haven't dug deeper to see if there's a better option
n
p
You can get cloudformation template diagrams from the deployed stack natively in AWS console, but as stated above, it’s not super valuable due to it being a lot of pieces
d
Ah, that makes sense. I think in my head I was hoping there would be some magical construct where we add a few comments in the infrastructure files and it creates some beautiful, commented diagram 😂. Thanks for the link @Nick Laffey. I’ll take a look 🙂
n
Im questioning whether what I sent you is actually valuable or not… it’s more tied into whatever their service is more than I originally thought it was.
d
Hahaha, I understand what you all mean now
t
lol
a
I’ve been using DIA, which converts CF JSON into diagram.
s
Yes, cdk-dia, it's an npm module. It uses the tree.json. It doesn't show cross stack association, but it's pretty good https://www.npmjs.com/package/cdk-dia
Run
npx cdk-dia
as a hook, to get diagram.png 👍
a
Yeah Im using it and it’s cool.
@Simon Reilly I have issues setting a custom path, did you?
Because I want to drop the PNGs into `/infra/`… but it breaks, only works on the root.
p
Yeah we use cdk dia 👍
a
It’s great because DIA can write the consumers/providers for Events on EBridge.
So it’s pretty good to have a good picture of how the arch is designed/connected.
Hope it can generate an editable file for LucidChart.