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

The API with ID xxx doesn’t include a route with path /* having an integration


I have HTTP API Gateway + Lambda setup. When I try to trigger the API I get 500 HTTP error:

The IAM role configured on the integration or API Gateway doesn't have permissions to call the integration.

The API Gateway is listed in the Lambda's triggers, but there's an error message there too:

The API with ID xxx doesn’t include a route with path /* having an integration arn:aws:lambda:us-east-1::function:lambda-name.

enter image description here

How do I fix this?


Solution

  • My mistake was that I published my Lambda and had multiple versions of it, but I added the resource-based policy only to the unversioned function and not to the versioned ones. After I added a policy to the version of the Lambda function that was used by the API Gateway, the error disappeared.

    For those who use Terraform resource aws_lambda_permission - you have to specify the qualifier argument, use the Lambda version as the value for it.

    My resource-based policy:

    enter image description here