How can I test AWS Lambda functions locally?

前端 未结 3 954
Happy的楠姐
Happy的楠姐 2021-02-04 05:48

Explain to me please what is the best way to locally test the lambda function. I used sam local and this solution https://github.com/lambci/docker-lambda for testin

3条回答
  •  一个人的身影
    2021-02-04 06:38

    For local manual testing (not unit testing) with sam cli you can specify the environment varilables file with the -n, --env-vars PATHoption and use your real resource identifiers like you would normally do within your Cloud Formation template (refer to the official documentation for more informations).

    This should let you invoke other functions directly and use a real DynamoDB table and all other AWS Cloud resources.

    Note: if you use VSCode you can try this helper extension.

提交回复
热议问题