AWS Certified Developer – Associate — Question 408

A developer at a company recently created a serverless application to process and show data from business reports. The application's user interface (UI) allows users to select and start processing the flies. The UI displays a message when the result is available to view. The application uses AWS Step Functions with AWS
Lambda functions to process the files. The developer used Amazon API Gateway and Lambda functions to create an API to support the UI.
The company's UI team reports that the request to process a file s often returning timeout errors because of the size or complexity of the files. The UI team wants the API to provide an immediate response so that the UI can display a message while the files are being processed. The backend process that is invoked by the
API needs to send an email message when the report processing is complete.
What should the developer do to configure the API to meet these requirements?

Answer options

Correct answer: A

Explanation

To enable asynchronous execution of the Lambda function from API Gateway, the 'X-Amz-Invocation-Type' header must be set to 'Event' in the integration request. This allows API Gateway to return an immediate 202 Accepted response to the UI instead of waiting for the execution to finish, preventing gateway timeouts. Other options, such as increasing timeouts, will not work because API Gateway has a maximum integration timeout limit of 29 seconds, which cannot be increased.