An API Gateway REST API integration targets the correct Lambda function, but API Gateway reports insufficient permission to invoke it. Which change should the developer make?
Show the answer
Correct answerC. Allow API Gateway invocation in the function's resource-based policy.
AWhy not this: The execution role controls the function's outbound AWS API access, not API Gateway's permission to invoke it.
BWhy not this: API Gateway invokes the Lambda service API; it does not connect to the function through its VPC security group.
CWhy this is right: A resource-based policy can grant the API Gateway service principal permission to invoke the function.
DWhy not this: API callers do not need to assume the Lambda execution role for an API Gateway integration.
A Lambda resource-based policy can authorize API Gateway to invoke the function, restricted by the API's source ARN. The execution role governs what the function can access, not which services can invoke it.