I am developing a REST API with
RDS (MySQL). I am using
Node.js. I am also using
AWS SAM tool.
In my API I have lambda functions that accept URL parameters and that do not accept them.
I noticed that I can deploy these to AWS without an issue, and then execute from
However when I try to locally run them, I am running into problems.
- When I execute
sam local invoke, it says
Error: You must provide a function logical ID when there are more than one functions in your template.So I had to execute them one by one, like
sam local invoke FunctionName
- When I try to invoke a function that accepts URL parameters, it says
TypeError: Cannot destructure property 'id' of 'event.queryStringParameters' as it is undefined.Here the
idis the name of the URL Param.
- How can I locally invoke all node.js functions, instead of one by one?
- How can I make sure that functions with URL Params also can be locally invoked?
Source: Docker Questions