code-dumps/aws/ec2-inventory.sh
2021-02-16 09:19:00 +08:00

4 lines
267 B
Bash
Executable File

#!/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