AWS Certified Developer – Associate (DVA-C02) — Question 318

A developer is building a serverless application on AWS for a workflow that processes high volumes of data. In the workflow, an AWS Step Functions state machine invokes several AWS Lambda functions.

One of the Lambda functions occasionally fails because of timeout errors during periods of high demand. The developer must ensure that the workflow automatically retries the failed function invocation if a timeout error occurs.

Which solution will meet this requirement?

Answer options

Correct answer: A

Explanation

AWS Step Functions allows developers to handle errors and retries directly within the state machine definition using the 'Retry' field, where specific error types like 'States.Timeout' can be targeted with custom retry behaviors. Option B is incorrect because the Timeout field only sets maximum execution duration, not retry behavior, while Option C's Fail state terminates execution with an error instead of retrying. Option D is incorrect because introducing Amazon SNS adds unnecessary architectural complexity and does not natively manage the state machine's retry logic for the Lambda function.