Handy tricks for pulling out AWS data. From time to time I find myself needing some quick and dirty reports detailing
aspects of a given AWS account. These helper scripts have helped me in my cunsulting work as no two clients are ever
using the same set of tools, and as a cunsultant I often find myself retrained by security contraints.
In general most of my code ( be it ruby, or jq ) uses some kind of simple cache mechanism. In most of these examples
I'm making the aws cli call and passing the data to a file. I then use the file with jq. This helps me tune and debug
the data as needed. I can also, obviously, reuse the data for different queries. Some day I might get around to making
this a little more sophisticated, but for now I usually run the script once, then comment the line out and run it again
as many times as is needed.
EC2 Instances
This gives me a mapping of the instance types used. This is most often useful in environments where we're using mostly
static instance builds without any clustering ( EKS, ECS ) or ASG's. This is a sure sign the the client does not have
a clean way to deploy code to newly created instances, which is a huge red flag.
EBS Blocks
This is a great way to get a sense for the size and usage of EBS blocks.
Snapshots
I've seen cases where Lambda functions are forgotten about and snapshots end up piling up over time. It's usually
not a big deal since snaps are cheap, but sometimes handy to know.