Skip to content

Instantly share code, notes, and snippets.

@tg
Last active August 10, 2018 16:29
Show Gist options
  • Save tg/3ca94aae4773074aa438 to your computer and use it in GitHub Desktop.
Save tg/3ca94aae4773074aa438 to your computer and use it in GitHub Desktop.
Get AWS Route53 health check IPs
# This script adds aws route53 health check IPs to security group
# Requires jq to be installed (https://github.com/stedolan/jq)
# Pass security group ID as first argument and port (range) as a second
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json |
jq '.prefixes[] | select(.service == "ROUTE53_HEALTHCHECKS") | .ip_prefix' |
xargs -t -n1 aws ec2 authorize-security-group-ingress --group-id "$1" --protocol tcp --port "$2" --cidr
# Print aws route53 health check IPs
# Requires jq to be installed (https://github.com/stedolan/jq)
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes[] | select(.service == "ROUTE53_HEALTHCHECKS") | .ip_prefix'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment