Search code examples
amazon-web-servicesaws-lambdaaws-api-gatewayserverless

AWS Lambda calling API gateway getting 500 internal server error


I'm developing several AWS serverless applications using Lambda and API gateway.

At one point, I tried to execute an API request on one application (using requests python lib) from code running inside a Lambda function in another application. I get 500 server error. From the logs it appears that the Lambda function behind the API gateway is not starting at all. I don't find any logs that can tell me what happened.

Additional details:


Solution

  • Possibly not relevant to OP, but this question pointed me in the right direction for a similar issue.

    For anyone hitting this error using AWS SAM, adding InvokeRole: NONE to your template prevents you from having to add permissions for every function to your Auth role, e.g.

    Auth:
      DefaultAuthorizer: AWS_IAM
      AddDefaultAuthorizerToCorsPreflight: false
      InvokeRole: NONE
    

    See GitHub for further info.