A serverless app uses Step Functions and Lambda to process uploaded report files. The UI calls an API (API Gateway + Lambda) to start processing; large or complex files are causing the API requests to time out. The UI team wants the API to return immediately so the UI can show a confirmation, and the backend must send an email when processing completes. How should the developer configure the API to meet these requirements?
Choose an answer
Tap an option to check your answer.
Correct answer: Modify the API Gateway integration request to add an X-Amz-Invocation-Type header with the static value "Event" on the route, then deploy the stage..
Why this is the answer
The correct solution is to configure the API Gateway integration request to add an X-Amz-Invocation-Type header with the static value "Event". This tells Lambda to invoke the function asynchronously, meaning API Gateway will not wait for the Lambda function to complete execution and will return an immediate 202 Accepted response to the client. This meets the requirement for the UI to receive an immediate confirmation. The backend Lambda function will continue processing and can send an email upon completion. Changing the Lambda function's maximum event age setting does not force asynchronous invocation; it controls retry behavior for asynchronous invocations. Increasing the API Gateway timeout would not solve the problem of immediate response; it would only allow the API to wait longer, still blocking the UI. The X-Amz-Target header is used for AWS service API calls, not for controlling Lambda invocation type via API Gateway.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed