[AWS] Lambda Invocation types

There are two types of invocation for Lambda:

  • Request/Response
  • Asynchronous invoaction

 

Demo by using AWS CLI:

Request/Response

aws lambda invoke --function-name hello-world \
--invocation-type RequestResponse \
--log-type Tail --payload '{"name": "AWSLambda"}' \
result.txt

It will also output a file called result.txt to save the response.

 

Asynchronous Invocation

aws lambda invoke --function-name hello-world \
--invocation-type Event \
--log-type Tail --payload '{"name": "AWS Lambda"}' \
result.txt

Becasue it is asyn, it won't output the response.

 

Error Handling

posted @ 2021-04-12 17:38  Zhentiw  阅读(114)  评论(0)    收藏  举报