Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[AWS CLI examples] #aws #cli
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[*]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[*].Tags[?Key==`Name`]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[?Tags[?starts_with(Value, `registration`)]]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[?Tags[?starts_with(Value, `email`)]]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[] | [?contains(Tags[?Key==`Name`].Value, `email-01`)]' --output table
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[] | [?contains(Tags[?Key==`Name`].Value, `email-01`)]' --output table
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[?contains(Tags[?Key==`Name`].Value, `email-01`)]'
aws ec2 describe-instances --filters "{\"Name\":\"tag:aws:cloudformation:logical-id\", \"Values\":[\"<something>\"]}" --filters "{\"Name\":\"tag:Environment\", \"Values\":[\"prod\"]}"
aws ec2 describe-instances --filters "{\"Name\":\"tag:Name\", \"Values\":[\"email*\"]}" | jq '.Reservations[].Instances[].InstanceId' | sort | uniq | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.