S3 object and lambda function in step machine with the asynchronous express workflows

0

My state machine starts with a MAP state. Inside the Map state, there are 2 tasks, one after one (task#1 invokes lambda A, task#2 invokes lambda B). The lambda A will process the files conversion, upload those files into S3, and return a S3 object key. The lambda B will grab the S3 object key from task#1, get the object from S3, and then interact with the third party API.

My question is that before the lambda B is invoked, is there a way to notify the state machine that the files have been saved in S3 and ready to be read? Could we implement the S3-EventBridge in the asynchronous express workflows?

1 Antwort
0
Akzeptierte Antwort

Why do you need to notify the state machine about it? Lambda A writes the file and only returns when the file is on S3. Lambda B will not be invoked until Lambda A finishes (assuming they are in sequence and not in a Parallel state).

profile pictureAWS
EXPERTE
Uri
beantwortet vor 2 Jahren
  • My bad, forget to mention that I am using python boto3 SDK for the lambda. When the uploading through upload_file() is finished, it returns nothing. So I am not sure that it means the files uploading are done or just S3 accepts the API call without an exception.

  • Should be done when it returns.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen