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

421
Vistas
Invoke AWS SAM local function from another SAM local function

I am trying to create an AWS SAM app with multiple AWS Serverless functions.

The app has 1 template.yaml file which have resource of 2 different serverless lambda functions, for instance "Consumer Lambda" and "Worker Lambda". Consumer gets triggered at a rate of 5 minutes. The consumer uses boto3 library to trigger the worker lambda function. This code works when the worker lambda is deployed on AWS.

But I want to test both the functions locally with Sam local invoke "Consumer" which invokes "Worker" also locally.

Here's a screenshot of the YAML file:

I am using Pycharm to run the project. There is an option to run only 1 function at a time which then creates only one folder in the build folder.

I have to test if Consumer is able to invoke worker locally in pycharm before deployment. I think there is some way to do it but not sure how to. I did some extensive search but didn't yield anything.

Any help is appreciated. Thanks in advance

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You can start the lambda invoke endpoint in the following way (official docs):

sam local start-lambda

Now you can point your AWS resource client to port 3001 and trigger the functions locally.

For eg. If you are doing this on Python, it can be acheived in the following way with boto3:

boto3

# Create a lambda client
lambda_client = boto3.client('lambda',
                             region_name="<localhost>",
                             endpoint_url="<http://127.0.0.1:3001>",
                             use_ssl=False,
                             verify=False)

# Invoke the function
lambda_client.invoke(FunctionName=<function_name>,
                     Payload=<lambda_payload>)
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