Created
January 15, 2025 15:09
-
-
Save nobiit/4383f9423f3326fd7283fefb4b761b8d to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| REGIONS="GLOBAL,ap-east-1,ap-southeast-1" | |
| SERVICES="CLOUDFRONT" | |
| curl -fsL https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '($regions_raw | split(",")) as $regions | ($services_raw | split(",")) as $services | .prefixes[] | select(.region as $region | $regions | contains([$region])) | select(.service as $service | $services | contains([$service])) | "add address=\(.ip_prefix) comment=\"aws/\(.region | ascii_downcase)/\(.service | ascii_downcase)\" list=aws_net"' --arg regions_raw "${REGIONS}" --arg services_raw "${SERVICES}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment