fix: fallback for ec2 script and only show running instances

This commit is contained in:
Noah Masur 2024-06-05 17:58:22 -04:00
parent 96d410e1b2
commit 99581ae1ea
No known key found for this signature in database

View File

@ -5,14 +5,15 @@
# Specify AWS_PROFILE and AWS_REGION before running this script
aws ec2 describe-instances |
aws ec2 describe-instances \
--filters "Name=instance-state-name,Values=running" |
jq -r \
'.Reservations[]
| .Instances[]
| .InstanceId + " - " +
(.PrivateIpAddress // "n/a") + " - " +
(.PublicIpAddress // "n/a") + " - " +
(.Tags | from_entries | .Name // "n/a")' |
(.Tags // [] | from_entries | .Name // "n/a")' |
fzf \
--height 100% \
--layout reverse \