Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

417
Views
Find out what IP a lambda function is running from

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?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Remember that when you configure your Lambda to work within a VPC, it is actually attached to the VPC (in fact it is running in an AWS managed VPC).

Instead you get an ENI for each Lambda through which the Lambda will speak for its outbound connections, this allows it to connect to your resources in the VPC.

At this time, the value for which availability zone you're running in is not accessible by the Lambda, here is a list of all available environment variables that Lambda has access to.

If you wanted to retrieve the ENI IP of what you were connecting to resources as you would need to communicate outbound to a resource in your VPC and have that return the IP address you connected on.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!