title: AWS APIGateway Lambda proxy integration- Execution failed due to configuration error: Invalid permissions on Lambda function
body: <p>I am relatively new to AWS and the beast. After working on API Gateway to Lambda proxy integration I am getting <code>Execution failed due to configuration error: Invalid permissions on Lambda function</code> </p>
  
  <p>I followed below setup referred from really well documented <code>terraform documentation</code> and does exactly what was needed for me. But while testing on API Gateway console giving the above error.</p>
  
  <pre><code>resource "aws_lambda_permission" "apigw" {
      statement_id  = "AllowAPIGatewayInvoke"
      action        = "lambda:InvokeFunction"
      function_name = "${aws_lambda_function.resource_name.arn}"
      principal     = "apigateway.amazonaws.com"
  
      # The /*/* portion grants access from any method on any resource
      # within the API Gateway "REST API".
      source_arn = "${aws_api_gateway_deployment.resource_name_of_deployment.execution_arn}/*/*"
    }
  </code></pre>