11/14/2018, 3:36 PM
Hi, i have a problem with an apigateway with apikey and lambda setup. My code is here : The problem is when i hit the URL with : curl -H "x-api-key:xxxxx" -H "Content-Type: application/json" i get internal server error. If go to the UI and lick on the lambda function in the Integration Request, i'm prompted with the "You are about to give API Gateway permission to invoke your Lambda function:" hit ok and then it works. I know i'm missing something but i don't know what. Can you guys help out?
Just in case anybody is wandering what was needed was to add as the message said the lambda permissions using something like:
Copy code
// Give permissions from API Gateway to invoke the Lambda
let invokePermission = new aws.lambda.Permission("api-lambda-permission", {
    action: "lambda:invokeFunction",
    function: lambda,
    principal: "<|>",
    sourceArn: deployment.executionArn.apply(arn => arn + "*/*"),