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

232
Visualizações
AWS Lambda function completion triggers another lambda function

I am trying to string together lambda functions. The first lambda function is on a 30 minute timer to scrape and put the data in a S3 bucket, the next lambda function retrieves and parses that data and puts it in a seperate S3 bucket, and the last function performs analysis on that data and sends the user (in this case myself) an email of the results via pythons smtplib module.

Instead of having the last two lambda functions running on timers, I want the second function to be triggered when the first function is done, and the last function to be triggered when the second function is done. As well as, deleting the two folders in the first S3 bucket and the contents in the second S3 bucket to save on memory and processing time.

Is there a way to do this totally in the AWS web interface rather than rewrite the python code I already have?

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

This sounds like you have a use case that can fulfilled by step functions.

You would add a flow which has the first Lambda called, then if successful call the second Lambda function passing input/output between.

You would update your scheduled action to execute the step function instead of the first Lambda.

over 4 years ago · Santiago Trujillo Relatório

0

It can be done by using S3 Put Event as a Trigger to Lambda.

Second and third lambda can have S3 Put Event Trigger.

 Timer                  Put Event                    Put Event          
-------Lambda_1 -> S3 ------------> Lambda_2 --> S3 ------------> Lambda_3 ---> Email  
  1. Timer will trigger first lamdba which will put file in S3 bucket
  2. PUT Event on S3 bucket will trigger Lambda_2 which will put file in S3 bucket.
  3. Again, PUT event on this bucket will trigger Lambda_3 which will trigger Email.

Check Below link for more info :

URL-1

URL-2

over 4 years ago · Santiago Trujillo Relatório

0

Another solution which would involve rewriting your python code, but only slightly, is:

import boto3
lambda_client = boto3.client('lambda')
payload = b'{"a": 1, "b": 2, "c": 3}'
response = lambda_client.invoke(
               FunctionName="my-second-function",
               InvocationType='Event',
               Payload=payload
           )

By contrast, I find Step Functions to be way more complicated.

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