A Step Functions state machine pauses when it receives an order until another service confirms the order by adding a record to a DynamoDB table. Which solution will allow the state machine to resume processing after the DynamoDB record appears?
Choose an answer
Tap an option to check your answer.
Correct answer: Subscribe a Lambda function to the DynamoDB stream so the function runs when a new record is added. When the function receives the appropriate record, call the Step Functions redrive execution command on the running state machine..
Why this is the answer
The correct solution uses a DynamoDB stream to trigger a Lambda function when a new record is added. This is an event-driven approach that avoids continuous polling, which is inefficient. The Lambda function can then identify the relevant record and signal the waiting Step Functions state machine to resume. The redrive execution command is not the correct mechanism here; instead, the Lambda function should use the SendTaskSuccess API call to signal the waiting Task state in Step Functions, passing the necessary output. The incorrect option of polling the DynamoDB table with a GetItem state within the state machine is inefficient and can lead to high costs, as it repeatedly checks for the record. Stopping and starting a new execution loses the state of the previous execution and is not a resumption. Having a Lambda function continuously poll is also inefficient and can lead to timeouts and failures, making it an unreliable solution.
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