Cyber Monday 2024! 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
4 months ago
Option B it is! No need to reinvent the wheel when AWS gives us the tools to handle this gracefully.
upvoted 0 times
Berry
3 months ago
That's true, sticking to the recommended approach will also make it easier for future maintenance and troubleshooting.
upvoted 0 times
...
Junita
3 months ago
I agree, it's important to leverage the existing functionality to keep the state machine logic simple and effective.
upvoted 0 times
...
Kristian
3 months ago
Exactly! AWS provides built-in features like catchers and maximum attempts to handle errors efficiently.
upvoted 0 times
...
Carmen
4 months 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
5 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
5 months ago
But wouldn't duplicating tasks add unnecessary complexity to the state machine?
upvoted 0 times
...
Sherman
5 months ago
I disagree, I believe option D is better. Duplicating the task and retrying with TryAgain seems more straightforward.
upvoted 0 times
...
Valentin
5 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
5 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
4 months ago
Absolutely, keeping things clean and simple is key when working with workflows.
upvoted 0 times
...
Olene
4 months ago
It definitely makes the state machine easier to manage in the long run.
upvoted 0 times
...
Janey
5 months ago
I agree, using the retrier functionality built into Step Functions is a smart choice.
upvoted 0 times
...
Mari
5 months ago
Option C is definitely the way to go. It's simple and efficient.
upvoted 0 times
...
...
Helga
5 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
5 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
5 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
5 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