Currently my end to end goal is to create a step function that is ran daily via Event Bridge.
The flow of the Step Function should be as follows:
My issue is around step 3 of the process. How can I send back a taskToken to the Step Function after the completion of the deletion of the RDS?
How can I send back a taskToken to the Step Function after the completion of the deletion of the RDS?
Send the task token to the Lambda via the task payload ("taskToken.$": "$$.Task.Token"
). Once your Lambda has confirmed instance deletion (say, with DescribeDBInstances), call the SendTaskSuccess command with the token. This informs the Step Functions service that the task is done and the execution can continue. Otherwise, if the Lambda fails to confirm deletion, let Step Functions know by invoking SendTaskFailure
with the token.
Is it possible to have an AWS Step Function wait until a RDS is deleted to continue?
Yes. Instance deletion is an asynchronous task. You have several options to architect waiting for the deletion to finish:
deletion
events. In other words, loosely couple the Delete-Lambda and the Recreate-Lambda with the asynchronous event pattern, rather than tightly coupling them in a State Machine.