Home > Enterprise >  Terraform API Gateway Not Showing Up As Trigger For Lambda
Terraform API Gateway Not Showing Up As Trigger For Lambda

Time:11-27

I followed the instructions enter image description here

However, when I look on the lambda the trigger is missing: enter image description here

When I try to hit the endpoint I get an "internal server error" message.

When I manually add the trigger in my lambda then it works but not under the 'profile' route key that I specified.

What am I missing here to correctly route my /profile in the API Gateway to my lambda?

CodePudding user response:

Based on the comments. The solution was to modify the permissions (remove source_arn):

resource "aws_lambda_permission" "execution_lambda_from_gateway" {
    statement_id  = "AllowExecutionFromAPIGateway"
    action        = "lambda:InvokeFunction"
    function_name = aws_lambda_function.executable.function_name
    principal     = "apigateway.amazonaws.com"
}
  • Related