Created
February 7, 2019 00:41
-
-
Save SupaMic/ffd09d35ed09312472fb1d2720a2311b to your computer and use it in GitHub Desktop.
Get the AWS IP Ranges for Cloud9 Servers which are needed to set inbound rules when connecting to outside servers by SSH
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
/* Might need to go to https://aws.amazon.com/ or use blank page to run */ | |
var arr=[]; | |
var oReq = new XMLHttpRequest(); | |
oReq.addEventListener("load", reqListener); | |
oReq.open("GET", "https://ip-ranges.amazonaws.com/ip-ranges.json"); | |
oReq.send(); | |
function reqListener () { | |
JSON.parse(this.responseText).prefixes.map(function(obj){ | |
if(obj.service == 'CLOUD9'){ | |
arr.push(obj.ip_prefix) | |
} | |
}) | |
console.log(arr.toString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment