Last active
August 10, 2018 16:29
-
-
Save tg/3ca94aae4773074aa438 to your computer and use it in GitHub Desktop.
Get AWS Route53 health check IPs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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