The WaitingCompletion
event is emitted by the OrderProcessor
workflow built in module 1. At this point in the order, the user has submitted their drink request, the OrderProcessor
workflow has generated an order number, and is now paused until the barista completes the order. The workflow has emitted a WaitingCompletion
event, along with a new TaskToken
which is used to resume the workflow.
You will now create a new rule to route this event to a Lambda function that will update the serverlesspresso-order-table
with the new TaskToken
, order number, and order state.
Go to the EventBridge console. From the AWS Management Console, select Services then select EventBridge Application Integration. Make sure your region is correct.
Choose Rules. Choose Create rule.
In Step 1 of the wizard:
Serverlesspresso
.{
"detail-type": ["OrderProcessor.WaitingCompletion"],
"source": ["awsserverlessda.serverlesspresso"]
}
WaitingCompletion
. Tip: You can start typing “WaitingCompletion” into the field to find the function.In Step 4 of the wizard, choose Next.
In Step 5 of the wizard, check that the Define rule detail panel that the Event bus is Serverlesspresso
. Choose Create rule.
In this section, you created 4 EventBridge rules on the Serverlesspresso event bus. On the Rules page, change the Event bus dropdown to Serverlesspresso
and verify that you see all 4 new rules listed (in addition to the 4 rules created in the setup process).
If you created a rule on the default bus instead, review the previous steps in this module to add the rules to the custom bus.