Last active
November 25, 2019 07:31
-
-
Save kevsersrca/4f9c280b01ef651e3060320bca505949 to your computer and use it in GitHub Desktop.
lambda ifconfig
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
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