exam questions

Exam AWS Certified Developer Associate All Questions

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

Exam AWS Certified Developer Associate topic 1 question 62 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 62
Topic #: 1
[All AWS Certified Developer Associate Questions]

A serverless application is using AWS Step Functions to process data and save it to a database. The application needs to validate some data with an external service before saving the data. The application will call the external service from an AWS Lambda function, and the external service will take a few hours to validate the data. The external service will respond to a webhook when the validation is complete.
A developer needs to pause the Step Functions workflow and wait for the response from the external service.
What should the developer do to meet this requirement?

  • A. Use the .wait ForTaskToken option in the Lambda function task state. Pass the token in the body.
  • B. Use the .waitForTaskToken option in the Lambda function task state. Pass the invocation request.
  • C. Call the Lambda function in synchronous mode. Wait for the external service to complete the processing.
  • D. Call the Lambda function in asynchronous mode. Use the Wait state until the external service completes the processing.
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
Vinafec
Highly Voted 2 years, 7 months ago
Selected Answer: A
It's A https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-example
upvoted 16 times
...
sumanshu
Most Recent 4 months, 1 week ago
Selected Answer: A
A) Correct - AWS Step Functions supports the callback pattern using the .waitForTaskToken feature. This approach allows the workflow to pause and wait for an external process or service to send a callback signal before continuing.
upvoted 1 times
sumanshu
4 months, 1 week ago
C) Eliminated - This is inefficient and unsuitable for a process that takes hours. AWS Lambda functions have a maximum timeout of 15 minutes, so they cannot wait for hours.
upvoted 1 times
sumanshu
4 months, 1 week ago
D) Eliminated - The Wait state in Step Functions is designed for predefined, fixed delays (e.g., wait for X seconds). It cannot pause indefinitely or until an external event occurs
upvoted 1 times
...
...
...
SD_CS
1 year, 2 months ago
Selected Answer: A
This is from AWS : "MessageBody": { "Message": "Hello from Step Functions!", "TaskToken.$": "$$.Task.Token" } The token is being passed in the message body
upvoted 1 times
...
sara_exam_topics
1 year, 6 months ago
Selected Answer: B
B. Use the .waitForTaskToken option in the Lambda function task state. Pass the invocation request. Here's why this is the appropriate choice: The .waitForTaskToken option allows you to pause the execution of the Step Functions workflow until a specific task token is returned by the external service. In this scenario, when the Lambda function is invoked to call the external service, it can provide the task token as part of its invocation request. The external service can then take the required time to validate the data, and when it's ready to respond, it should include the task token in its response. When the Step Functions workflow receives the response with the task token, it will be able to correlate the response with the specific task in the workflow and resume its execution accordingly.
upvoted 1 times
...
rcaliandro
1 year, 10 months ago
Can someone explain to me why we have to use the .wait ForTaskToken? Can be the C correct? Imagine that there are two tasks A and B, if the task A call synchronously a lamda function, then B needs to wait A to finish for definition. And this because A and B are two consecutive tasks and non parallel
upvoted 1 times
ninomfr64
1 year, 8 months ago
When you asynchronously invoke a Lambda function, the Lambda places the event in a queue and returns a success response without additional information. However you do not know if the actual function outcome. In your scenario, A asynchronously invoke the function and move forward without knowing if the lambda succeeded or not. https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#:~:text=For%20asynchronous%20invocation%2C%20Lambda%20places%20the%20event%20in%20a%20queue%20and%20returns%20a%20success%20response%20without%20additional%20information
upvoted 1 times
...
...
ezredame
1 year, 11 months ago
Selected Answer: A
The .waitForTaskToken option allows Step Functions to pause the workflow until a specific task is completed. In this case, when the Lambda function is invoked, it can generate a token using the TaskToken field provided by Step Functions. This token is then passed in the response body of the Lambda function, indicating that the task is not complete yet. Step Functions will then wait for the task to complete and provide the token back to the Lambda function in the input of the next state, allowing it to resume execution.
upvoted 2 times
...
MrTee
2 years ago
Selected Answer: B
The best option to meet the requirement of pausing the Step Functions workflow and waiting for the response from the external service is B. Use the .waitForTaskToken option in the Lambda function task state and pass the invocation request. Option A is incorrect because the .waitForTaskToken option should be used instead of .wait for the Lambda function task state. The .waitForTaskToken option allows Step Functions to provide a task token to the Lambda function, and the Lambda function can use this token to notify Step Functions when it's done processing.
upvoted 2 times
...
pancman
2 years, 2 months ago
The answer is A and I am 100% sure. The task token is passed in the body. Check this page to see for yourself: https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-example
upvoted 3 times
...
gaddour_med
2 years, 2 months ago
C: lambda will pass request to third party service and return to step. step will continue before that third party service finish. D: step will send request to lambda in asynchronous and will wait. but it can not know for haw much time it will wait because processing time is unknown so we can not use Wait state. A is correct.
upvoted 2 times
...
sichilam
2 years, 3 months ago
A is correct
upvoted 1 times
...
david00
2 years, 7 months ago
A :https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-example
upvoted 1 times
...
Harry_01
2 years, 7 months ago
Selected Answer: D
Just curious to know, wouldn't the Lambda time out? as the question says "the external service will take a few hours" and Lambda cannot wait that long. I was leaning more towards Option D. Can someone explain what is wrong with option D?
upvoted 4 times
Arnaud92
2 years, 6 months ago
The step function is doing the waiting, not the lambda
upvoted 3 times
...
...
Danbraga
2 years, 7 months ago
Selected Answer: A
i would go for A https://instil.co/blog/step-functions-and-task-tokens/
upvoted 4 times
...
Spamuel
2 years, 7 months ago
Selected Answer: B
I think it's B... https://docs.aws.amazon.com/step-functions/latest/dg/connect-lambda.html
upvoted 1 times
...
JAMG54
2 years, 7 months ago
Maybe B. Token is get accessed from context object for that reason A is not accurate for me. The other ones not seems be the correct.
upvoted 1 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