
Answer-first summary for fast verification
Answer: If you create a stage variable to call a Lambda function through your API, you must add the required permissions. Update your Lambda function's resource-based AWS Identity and Access Management (IAM) policy so that it grants invoke permission to the API Gateway
If you create a stage variable to call a Lambda function through your API, you must add the required permissions. Update your Lambda function's resource-based AWS Identity and Access Management (IAM) policy so that it grants invoke permission to the API Gateway If your Lambda function's resource-based policy doesn't include permissions for your API to invoke the function, API Gateway returns an Internal server error message. If you create a stage variable to call a function through your API, you must add the required permissions by doing one of the following: Update your Lambda function's resource-based AWS Identity and Access Management (IAM) policy so that it grants invoke permission to API Gateway. OR Create an IAM role that API Gateway can assume to invoke your Lambda function. If you build an API Gateway API with standard Lambda integration using the API Gateway console, the console adds the required permissions automatically.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A developer has configured an API Gateway in AWS and integrated it with an AWS Lambda function using stage variables to manage different environments. Upon invoking the API method, the developer encounters an "Internal server error" with a 500 status code.
What steps should the developer take to resolve this issue?
A
If you create a stage variable to call a Lambda function through your API, you must add the required permissions. Update your Lambda function's resource-based AWS Identity and Access Management (IAM) policy so that it grants invoke permission to the API Gateway
B
API calls can't exceed the maximum allowed API request rate per account and per Region. Implement error retries and exponential backoffs to fix the error
C
When setting the Lambda function as the value of a stage variable, use the function's ARN and not the function alias for setting up the value
D
If you create a stage variable to call a function through your API, you must add the required permissions. Create an IAM role that your Lambda function can assume when invoking the respective AWS resources