I hava a lambda function that runs from a VPC. We have three avalability zones configured for HA. I would like to know from which Availability Zone is each Lambda invocation running.
My lamdba uses python 3.7 as runtime
I tried this
import socket
hostname = socket.gethostname()
IPAddr = socket.gethostbyname(hostname)
print("Your Computer Name is:" + hostname)
print("Your Computer IP Address is:" + IPAddr)
But this gives me:
Your Computer Name is:169.254.128.117
Your Computer IP Address is:169.254.128.117
which is not helpful.
How can I know what private IP the lambda function is using?