Lono Xgraph - Visualizing the CloudFormation Template Dependency Graph
It can be difficult to understand the CloudFormation resources and their dependencies when working with a complicated CloudFormation template. We’ll run through some commands to try to help understand their dependencies.
Here are the commands that I ran in the video:
curl -o "waf.json" https://s3.amazonaws.com/solutions-reference/aws-waf-security-automations/latest/aws-waf-security-automations.template
cat waf.json | jq '.Resources | keys[]'
cat waf.json | jq '.Resources | keys[]' | wc -l
grep DependsOn waf.json
grep DependsOn waf.json | wc -l
What the above commands did:
- Downloads the template
- Summarize the resource logical names
- Count the resources
- Summarize the DependsOn
- Count the explicit DependsOn usage
It’s still a little tough to visualize the dependencies though.
The lono xgraph command
You’ll need to be in a lono project. You can quickly generate one with:
lono new infra
cd infra
lono xgraph
helps you visualize the dependencies with a picture.
lono import https://s3.amazonaws.com/solutions-reference/aws-waf-security-automations/latest/aws-waf-security-automations.template --name waf
lono xgraph waf
You end up with a dependency graph chart that looks like this.
Note, I zoomed in on the dependency graph because there are so many resources in this template. 😁
That’s it! The official documentation is at lono.cloud/reference/lono-xgraph. Hope that helps! 🎉 Hope that helps!
Related Post: Lono Summary Tutorial Introduction - Summarize CloudFormation Template
Thanks for reading this far. If you found this article useful, I'd really appreciate it if you share this article so others can find it too! Thanks 😁 Also follow me on Twitter.
Got questions? Check out BoltOps.
You might also like
More tools:
-
Kubes
Kubes: Kubernetes Deployment Tool
Kubes is a Kubernetes Deployment Tool. It builds the docker image, creates the Kubernetes YAML, and runs kubectl apply. It automates the deployment process and saves you precious finger-typing energy.
-
Jets
Jets: The Ruby Serverless Framework
Ruby on Jets allows you to create and deploy serverless services with ease, and to seamlessly glue AWS services together with the most beautiful dynamic language: Ruby. It includes everything you need to build an API and deploy it to AWS Lambda. Jets leverages the power of Ruby to make serverless joyful for everyone.
-
Lono
Lono: The CloudFormation Framework
Building infrastructure-as-code is challenging. Lono makes it much easier and fun. It includes everything you need to manage and deploy infrastructure-as-code.