aws-samples / api-gateway-secure-pet-store

Amazon API Gateway sample using Amazon Cognito credentials through AWS Lambda
Apache License 2.0
307 stars 113 forks source link

Cognito Auth_Role must include lambda:InvokeFunction #24

Open bashirpartovi opened 8 years ago

bashirpartovi commented 8 years ago

Cognito _AuthRole role must include permission to call Lambda function. In the README section, please include a note about adding lambda:InvokeFunction permission to the auth role's policy. { "Effect": "Allow", "Action": [ "lambda:InvokeFunction" ], "Resource": [ "<ARN OF LAMBDA FUNCTION>" ] }

If this is not added, the user could be getting the following error trying to call the API from a browser:

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 403.