exam questions

Exam AWS Certified Developer - Associate DVA-C02 All Questions

View all questions & answers for the AWS Certified Developer - Associate DVA-C02 exam

Exam AWS Certified Developer - Associate DVA-C02 topic 1 question 170 discussion

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 files. 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 is 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?

  • A. Change the API Gateway route to add an X-Amz-Invocation-Type header with a static value of ‘Event’ in the integration request. Deploy the API Gateway stage to apply the changes.
  • B. Change the configuration of the Lambda function that implements the request to process a file. Configure the maximum age of the event so that the Lambda function will run asynchronously.
  • C. Change the API Gateway timeout value to match the Lambda function timeout value. Deploy the API Gateway stage to apply the changes.
  • D. Change the API Gateway route to add an X-Amz-Target header with a static value of ‘Async’ in the integration request. Deploy the API Gateway stage to apply the changes.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
SerialiDr
Highly Voted 1 year, 3 months ago
Selected Answer: A
Change the API Gateway route to add an X-Amz-Invocation-Type header with a static value of ‘Event’ in the integration request: This is the correct approach. By setting the X-Amz-Invocation-Type header to Event in the API Gateway integration request, the API Gateway will invoke the Lambda function asynchronously. In asynchronous execution, the Lambda function returns an immediate response (202 or Accepted status) to API Gateway, which can then relay it back to the UI. Meanwhile, the Lambda function processes the file in the background.
upvoted 5 times
...
albert_kuo
Most Recent 7 months, 2 weeks ago
Selected Answer: A
curl -X POST \ -H "X-Amz-Invocation-Type: Event" \ https://lambda-endpoint.amazonaws.com/2015-03-31/functions/my-function/invocations \ -d '{ "key1": "value1" }'
upvoted 1 times
...
ltfalcon
8 months ago
According chatgpt correct is A. D is wrong because header value is set for Async and it should be set for Event This header is incorrect for this use case. The correct header for asynchronous invocation of Lambda is X-Amz-Invocation-Type with the value 'Event', not 'Async'.
upvoted 1 times
...
Saurabh04
9 months ago
Selected Answer: D
By adding the X-Amz-Target header with a value of 'Async', the API Gateway will invoke the backend Lambda function asynchronously.
upvoted 1 times
...
65703c1
11 months, 3 weeks ago
Selected Answer: A
A is the correct answer.
upvoted 1 times
...
JLLNOR
1 year, 4 months ago
Selected Answer: A
https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-integration-async.html
upvoted 4 times
...
Certified101
1 year, 5 months ago
Selected Answer: A
https://www.examtopics.com/discussions/amazon/view/82655-exam-aws-certified-developer-associate-topic-1-question-85/
upvoted 3 times
...
TanTran04
1 year, 5 months ago
Selected Answer: D
Option A is incorrect because the X-Amz-Invocation-Type header with a static value of 'Event' is used for the AWS Lambda asynchronous invocation, but it doesn't address the issue of providing an immediate response to the UI. Option D is the correct choice. By adding an X-Amz-Target header with a static value of 'Async' in the integration request, the API Gateway will immediately return a response to the UI, allowing it to display a message while the backend processing continues asynchronously. This ensures that the UI team does not encounter timeout errors due to long-running processes.
upvoted 1 times
TanTran04
1 year, 4 months ago
I miss something, Option D is undocumented. => A is the best choice
upvoted 2 times
...
...
LemonGremlin
1 year, 6 months ago
Selected Answer: A
Reference: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-integration-async.html
upvoted 2 times
...
kashtelyan
1 year, 6 months ago
Selected Answer: D
Option A involves changing the API Gateway route to add an X-Amz-Invocation-Type header with a static value of 'Event' in the integration request. This header is typically used when you want to invoke a Lambda function asynchronously, but it doesn't ensure that you get an immediate response. It essentially sends the request to a queue for asynchronous execution and doesn't wait for the processing to complete before providing a response. In contrast, option D suggests using the X-Amz-Target header with a static value of 'Async,' which is a more appropriate choice when you need to provide an immediate response to the client while offloading the processing for background execution. This approach better aligns with the requirement of displaying a message to the user while the files are being processed, which is typically achieved through asynchronous processing with notification upon completion.
upvoted 4 times
...
Digo30sp
1 year, 7 months ago
Selected Answer: A
A) https://www.examtopics.com/discussions/amazon/view/82655-exam-aws-certified-developer-associate-topic-1-question-85/
upvoted 2 times
...
fordiscussionstwo
1 year, 7 months ago
aaaaaaaaaAAAAAAAAAAAAAAAA
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago