Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

420
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda