I have completed the Notes App tutorial (the only change being that I am connecting to a MongoDB).
The Notes App was created by using the infrastructure ymls in Resources.
Everything is working.
I then decided to alter the serverless.yml and add back in the supplied ‘hello’ api (including adding the handler.js to the project).
With that done I then executed $serverless deploy —stage dev
When I run an ‘npx aws-api-gateway-cli-test’ with the ‘—path-template=‘/hello’’ it gives me a ’403 forbidden’.
Executing in the Amazon API Gateway gives 200.
Aside: the reason I added the supplied ‘hello’ API back in is because I have also set up a new project that is having the same issue - I can’t call any of it’s APIs as they all give ’403 forbidden’.
I’ve tried all the troubleshooting I could find on the web but no joy.
Here is the hello API as defined in the serverless.yml:
functions:
hello:
handler: handler.hello
events:
- http:
path: hello
method: get
authorizer: aws_iam
The only other difference from the tutorial is that as I am not connecting to Dynamo I don’t have any iamRoleStatements defined in the serverless.yml.
Any help greatly appreciated as I completely new to this.