Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Amazon Exam DVA-C02 Topic 5 Question 30 Discussion

Actual exam question for Amazon's DVA-C02 exam
Question #: 30
Topic #: 5
[All DVA-C02 Questions]

A developer is using AWS Step Functions to automate a workflow The workflow defines each step as an AWS Lambda function task The developer notices that runs of the Step Functions state machine fail in the GetResource task with either an UlegalArgumentException error or a TooManyRequestsException error

The developer wants the state machine to stop running when the state machine encounters an UlegalArgumentException error. The state machine needs to retry the GetResource task one additional time after 10 seconds if the state machine encounters a TooManyRequestsException error. If the second attempt fails, the developer wants the state machine to stop running.

How can the developer implement the Lambda retry functionality without adding unnecessary complexity to the state machine'?

Show Suggested Answer Hide Answer
Suggested Answer: C

Step Functions Retriers: Retriers provide a built-in way to gracefully handle transient errors within State Machines. Here's how to use them:

Directly attach a retrier to the problematic 'GetResource' task.

Configure the retrier:

ErrorEquals:Set this to ['TooManyRequestsException'] to target the specific error.

IntervalSeconds:Set to 10 for the desired retry delay.

MaxAttempts:Set to 1, as you want only one retry attempt.

Error Handling:

Upon 'TooManyRequestsException', the retrier triggers the task again after 10 seconds.

On a second failure, Step Functions moves to the next state or fails the workflow, as per your design.

'IllegalArgumentException' causes error propagation as intended.


Error Handling in Step Functions:https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html

Contribute your Thoughts:

Keneth
27 days ago
Option B it is! No need to reinvent the wheel when AWS gives us the tools to handle this gracefully.
upvoted 0 times
Carmen
17 days ago
Option B it is! No need to reinvent the wheel when AWS gives us the tools to handle this gracefully.
upvoted 0 times
...
...
Sherman
1 months ago
I see your point, but I still think having a separate task for retrying is more clear in this case.
upvoted 0 times
...
Helga
1 months ago
But wouldn't duplicating tasks add unnecessary complexity to the state machine?
upvoted 0 times
...
Sherman
1 months ago
I disagree, I believe option D is better. Duplicating the task and retrying with TryAgain seems more straightforward.
upvoted 0 times
...
Valentin
2 months ago
Option D seems a bit convoluted. Duplicating the task and adding a catcher feels like overkill for this use case.
upvoted 0 times
...
Gary
2 months ago
I like how Option C uses the built-in retrier functionality of Step Functions. Keeps the state machine clean and easy to maintain.
upvoted 0 times
Maybelle
14 days ago
Absolutely, keeping things clean and simple is key when working with workflows.
upvoted 0 times
...
Olene
22 days ago
It definitely makes the state machine easier to manage in the long run.
upvoted 0 times
...
Janey
1 months ago
I agree, using the retrier functionality built into Step Functions is a smart choice.
upvoted 0 times
...
Mari
1 months ago
Option C is definitely the way to go. It's simple and efficient.
upvoted 0 times
...
...
Helga
2 months ago
I think option A is the best choice. Adding a Delay task after GetResource seems like a simple solution.
upvoted 0 times
...
Alfred
2 months ago
Option B looks like the simplest and most straightforward way to handle the retries. No need to add extra tasks or complexity.
upvoted 0 times
Pok
2 months ago
Yeah, I think adding a catcher to the GetResource task for TooManyRequestsException with a maximum attempts value of 1 is a clean solution.
upvoted 0 times
...
Tasia
2 months ago
I agree, option B seems like the best choice here. It keeps it simple and handles the retries efficiently.
upvoted 0 times
...
...

Save Cancel