code-dumps/aws/ec2-inventory.sh

4 lines
267 B
Bash
Raw Permalink Normal View History

2024-10-24 23:09:21 +08:00
#!/bin/bash
aws ec2 describe-instances | jq -cr '.Reservations[].Instances[] | [.InstanceId,.PublicIpAddress,.PrivateIpAddress,(.Tags[] | select(.Key=="Name")| .Value), .InstanceType, .Placement.AvailabilityZone, .Platform, .State.Name] | @csv' > ec2-inventory.csv