4 ms·
Along the same lines, if you want to make your own AWS Lambda /API Gateway version of this: def lambda_handler(event, context): return {
by banana_giraffe 6y ago
Along the same lines, if you want to make your own AWS Lambda /API Gateway version of this:
def lambda_handler(event, context):
return {
'statusCode': '200',
'headers': None,
'body': event.get('requestContext', {}).get('identity', {}).get('sourceIp', 'unknown')
}
I do this, though my lambda is a bit more complex in practice, since I have some triggers that say "if this thing reports a new IP, do something".
Of course, AWS provides this basic service as checkip.amazonaws.com
- anonymouse008 6y agoThat's a brilliant way of adding and removing SSH security group rules for digital nomads
- banana_giraffe 6y agoThat's exactly what I use it for. I have a small program on my laptop that makes a request of my lambda every now and then (and if it senses a change of the network). It triggers a change in the firewall rules for a SSH server. Between that and Mosh, I barely even notice when I change networks.