Skip to content

Instantly share code, notes, and snippets.

Dan Pritts danpritts

Block or report user

Report or block danpritts

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:a49cc673ad20a1e7fb56

Using aws-cli and jq

list all instances for all ASGs

aws autoscaling describe-auto-scaling-instances \
  | jq '.AutoScalingInstances[] | {AutoScalingGroupName, InstanceId}'

list instance IDs for a particular ASG

@hummus
hummus / gist:8592113
Last active Oct 10, 2019
aws cli + jq example
View gist:8592113
wget http://stedolan.github.io/jq/download/linux64/jq
aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \
"Name=instance-state-name,Values=running" \
| jq -r \
".Reservations[] | .Instances[] | .InstanceId" \
aws ec2 describe-volumes --filters \
"Name=status,Values=available" \
| jq -r ".Volumes[] | .VolumeId" \
You can’t perform that action at this time.