AWS CloudFormation Templates and jq
Tips. In this video, I'll show you how to use jq
to quickly summarize what resources are defined in a CloudFormation template. I found this to be useful to help understand how a CloudFormation template works.
Commands:
cat autoscaling.json | jq '.'
cat autoscaling.json | jq 'keys[]'
cat autoscaling.json | jq --compact-output '. | leaf_paths' | sed -e 's/,[0-9][0-9]*,/,1000,/g' | sed -e 's/,[0-9][0-9]*\]/,1000\]/g' | sort -u
cat autoscaling.json | jq '.Resources'
cat autoscaling.json | jq '.Resources | to_entries'
cat autoscaling.json | jq -r '.Resources | to_entries | .[].value.Type' | sort | uniq -c | sort -r
Cool Tips
36m
Get full access to these great resources
All for less than the price of coffee a day