Skip to content

Instantly share code, notes, and snippets.

Last active Apr 20, 2022
What would you like to do?
AWS CLI Snippets
# Get a list of all SSM managed instances that appear to be online
aws ssm describe-instance-information --filter Key=PingStatus,Values=Online --query "InstanceInformationList[*].{Instance:InstanceId,Name:Name}" --output=text
# Get a list of all IPs for a service in region
# Way 1: using prefix lists
aws ec2 get-managed-prefix-list-entries --prefix-list-id pl-b8a742d1
# Way 2: using ip-ranges.json
curl | jq '.prefixes | map(select(.region=="ap-southeast-2" and .service=="EC2")) | map(.ip_prefix) | .[]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment