Skip to content

Commit

Permalink
ssh: filter instances by PingStatus to ensure only get online instanc…
Browse files Browse the repository at this point in the history
…es (#26)
  • Loading branch information
qedgardo authored Nov 22, 2024
1 parent 56d74da commit 2857567
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aws-connect
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ get_instance_by_ssm_name() {

instance_id=$(aws ssm describe-instance-information \
--filters "Key=tag:Name,Values=${name}" \
--query 'InstanceInformationList[*].{Instance:InstanceId,Name:Name}' \
--query 'InstanceInformationList[?PingStatus==`Online`].{Instance:InstanceId,Name:Name,Status:PingStatus}' \
--output json \
--region "${region}" \
--profile "${profile}" | jq -r '.[0].Instance')
Expand Down

0 comments on commit 2857567

Please sign in to comment.