From 99581ae1eaa29f93a83743c3b98a7302d7ed4f11 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:58:22 -0400 Subject: [PATCH] fix: fallback for ec2 script and only show running instances --- modules/common/shell/bash/scripts/aws-ec2.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/common/shell/bash/scripts/aws-ec2.sh b/modules/common/shell/bash/scripts/aws-ec2.sh index 5410ed0..1a787ab 100755 --- a/modules/common/shell/bash/scripts/aws-ec2.sh +++ b/modules/common/shell/bash/scripts/aws-ec2.sh @@ -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 \