mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-22 07:35:38 +00:00
fix: fallback for ec2 script and only show running instances
This commit is contained in:
parent
96d410e1b2
commit
99581ae1ea
@ -5,14 +5,15 @@
|
|||||||
|
|
||||||
# Specify AWS_PROFILE and AWS_REGION before running this script
|
# 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 \
|
jq -r \
|
||||||
'.Reservations[]
|
'.Reservations[]
|
||||||
| .Instances[]
|
| .Instances[]
|
||||||
| .InstanceId + " - " +
|
| .InstanceId + " - " +
|
||||||
(.PrivateIpAddress // "n/a") + " - " +
|
(.PrivateIpAddress // "n/a") + " - " +
|
||||||
(.PublicIpAddress // "n/a") + " - " +
|
(.PublicIpAddress // "n/a") + " - " +
|
||||||
(.Tags | from_entries | .Name // "n/a")' |
|
(.Tags // [] | from_entries | .Name // "n/a")' |
|
||||||
fzf \
|
fzf \
|
||||||
--height 100% \
|
--height 100% \
|
||||||
--layout reverse \
|
--layout reverse \
|
||||||
|
Loading…
Reference in New Issue
Block a user