Created
November 16, 2016 15:26
-
-
Save stephenrichards/1d53c9b19f08ee9ef8b0ec842d4fec3f to your computer and use it in GitHub Desktop.
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
require 'rest-client' | |
require 'ap' | |
response = RestClient.get 'https://ip-ranges.amazonaws.com/ip-ranges.json', accept: :json | |
hash = JSON.parse(response.body) | |
regions = hash['prefixes'] | |
ranges = [] | |
regions.each do |region| | |
ranges << region['ip_prefix'] if region['region'] == 'eu-west-1' | |
end | |
ap ranges |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment