State Machines
Add some state machines to process events
Add state machine for LEGO gifts
import {
StateMachine,
StateMachineType,
TaskInput,
} from "aws-cdk-lib/aws-stepfunctions";
const legoGiftStateMachine = new StateMachine(
this,
"EDAWorkshopLegoGiftStateMachine-YOUR_USER_NAME",
{
definition: new EventBridgePutEvents(this, "PutLegoGiftEvent", {
entries: [
{
eventBus: EventBus.fromEventBusArn(
this,
"EDAWorkshopCentralBus-YOUR_USER_NAME",
"CENTRAL_EVENT_BUS_ARN"
),
detail: TaskInput.fromObject({
legoSet: JsonPath.stringAt("$.legoSKU"),
giftTo: JsonPath.stringAt("$.from"),
}),
detailType: "GiftRequested",
source: "elf-YOUR_NAME",
},
],
}),
stateMachineName: "EDAWorkshopLegoGiftStateMachine-YOUR_USER_NAME",
stateMachineType: StateMachineType.EXPRESS,
}
);Add state machine for surprise gifts
Add event rules
Last updated