Created
November 20, 2021 21:48
-
-
Save ChrisSwanson/3f6b039b13474e456bf4b725ba9018eb to your computer and use it in GitHub Desktop.
AWS Regions JSON oneliner
This file contains 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
# requires pup, and jq to be installed | |
# this is likely to break based on the css selector, but a quick hack for now. | |
curl "https://docs.aws.amazon.com/general/latest/gr/rande.html" | pup "#w420aac12b7b9c13 > tbody > tr json{}" | jq '.[].children | { region: .[1].text, name: .[0].text} ' | sed -e '$!s/"$/",/' | sed -e 's/}/},/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment