Skip to content

Instantly share code, notes, and snippets.

@kevsersrca
Last active November 25, 2019 07:31
Show Gist options
  • Save kevsersrca/4f9c280b01ef651e3060320bca505949 to your computer and use it in GitHub Desktop.
Save kevsersrca/4f9c280b01ef651e3060320bca505949 to your computer and use it in GitHub Desktop.
lambda ifconfig
var http = require('http');
exports.handler = function( event, context ){
http.get({'host': 'api.ipify.org', 'port': 80, 'path': '/'}, function(resp) {
resp.on('data', function(ip) {
context.succeed(ip.toString());
});
resp.on('error', context.fail);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment