NEW: ec2 csv inventory

This commit is contained in:
xpk 2021-02-16 09:19:00 +08:00
parent 7c773451be
commit 8c07b44fcf
Signed by: xpk
GPG Key ID: CD4FF6793F09AB86
1 changed files with 3 additions and 0 deletions

3
aws/ec2-inventory.sh Executable file
View File

@ -0,0 +1,3 @@
#!/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