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 年前522 查看次数
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
专家
已审核 13 天前
  • Hi, Uri. Thank you so much.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则