Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

419
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda