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
已提問 2 年前檢視次數 544 次
1 個回答
1
已接受的答案

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
專家
Uri
已回答 2 年前
profile picture
專家
已審閱 24 天前
  • Hi, Uri. Thank you so much.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南