A developer uses AWS Step Functions where each step invokes a Lambda function. The state machine fails in the GetResource task with either IllegalArgumentException or TooManyRequestsException. Requirement: when IllegalArgumentException occurs, the state machine should stop immediately. When TooManyRequestsException occurs, the state machine should retry the GetResource task one more time after a 10-second wait; if that retry fails, the state machine should stop. How can the developer implement the Lambda retry behavior without adding extra steps to the state machine?
Choose an answer
Tap an option to check your answer.
Correct answer: Add a Retry policy to the GetResource state. Configure the Retry with error type TooManyRequestsException, a 10-second interval, and a maximum attempts value of 1..
Why this is the answer
The correct answer is to add a Retry policy to the GetResource state. Step Functions allows you to define retry behavior directly within a state's definition using the Retry field. This enables you to specify which errors to retry, the interval between retries, and the maximum number of attempts, all without adding extra states. For TooManyRequestsException, configuring a Retry with a 10-second interval and a maximum of 1 attempt (meaning one retry after the initial failure) directly addresses the requirement. For IllegalArgumentException, the absence of a specific Retry rule for this error means the state machine will stop immediately, fulfilling that requirement as well. The other options are incorrect because: Adding a Delay state and routing to it with a Catcher would introduce an extra state, which the requirement explicitly forbids. Configuring a Catcher with an interval and maximum attempts does not exist as a direct feature in Step Functions for retries; Catchers are for error handling and state transitions, not for automatic retries within the same state. Duplicating the GetResource state and using a Catcher to transition to it would also add an extra state and increase the complexity of the state machine definition.
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