AWS Lambda duplicate invocation specifications

0

I would like to clarify the specification that AWS Lambda is invoked multiple times in a single call or event.
However, except in the case of duplicate invocation due to errors.

Are the following specifications correct?
https://docs.aws.amazon.com/ja_jp/lambda/latest/dg/lambda-services.html

  1. Synchronous invocation by AWS Lambda
    ex.)
    aws lambda invoke --invocation-type RequestResponse
    
    → Exactly once??.
  2. Asynchronous invocation by AWS Lambda
    ex.)
    aws lambda invoke --invocation-type Event
    
    At least once.
  3. Event-driven; synchronous invocation
    ex.)
    Cognito
    API Gateway(synchronous invocation)
    
    → Exactly once??.
  4. Event-driven; asynchronous invocation
    ex.)
    Cloudwatch Event
    Cloudwatch Logs
    S3
    
    At least once.
  5. Lambda polling1
    ex.)
    SQS(basic)
    
    At least once.
  6. Lambda polling2
    ex.)
    SQS(FIFO)
    DynamoDB(Streasm)
    
    → Exactly once??.
tamura
demandé il y a 2 ans530 vues
1 réponse
1
Réponse acceptée

For all the synchronous invocations (1 and 3), the number of invocations depends on the client. If the client invokes the function once, the function will run exactly once.

For asynchronous invocations (2 and 4), events are added to an internal queue and the functions will run at least once.

For polling use cases (5 and 6, but also Kinesis Data streams, DynamoDB streams, MSK and MQ), the invocation is actually synchronous, however, SQS may deliver a message more than once, so the function may run more than once. With FIFO, messages are delivered exactly once, but due to function errors, we may invoke the function more than once. Same for the other cases.

profile pictureAWS
EXPERT
Uri
répondu il y a 2 ans
profile picture
EXPERT
vérifié il y a 17 jours
  • Hi, Uri. Thank you so much.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions