A developer is migrating a REST API endpoint in Amazon API Gateway that currently uses a Lambda custom integration to a Lambda proxy integration. Which of the following actions must the developer perform to ensure the API and backend Lambda function work correctly with the new integration? (Select TWO.)
- Modify the Lambda function response to return a JSON object containing the keys , , and .Answer
- BConfigure an integration request mapping template in API Gateway to map the incoming JSON payload to the Lambda event structure.
- Remove any configured integration responses and method response mappings from the API Gateway resource.Answer
- DDefine explicit method responses in API Gateway for each HTTP status code (, , and ) to map backend errors to client responses.
- EDeploy a custom Lambda authorizer to validate the Amazon Cognito JSON Web Token (JWT) in the request header.
Answer
Modify the Lambda function response to return a JSON object containing the keys , , and , and remove any configured integration responses and method response mappings from the API Gateway resource.
The correct actions are to modify the Lambda function response format and remove configured integration/method responses. In a Lambda proxy integration, API Gateway bypasses integration and method response configurations, passing the backend response directly to the client. This requires the Lambda function to return a structured JSON response containing the HTTP status code, headers, and stringified body.
Step-by-Step Solution
Key Concept
Understanding request and response handling differences between API Gateway Lambda Proxy and Lambda Custom integrations.
Estimated Time:2m 0s