I am trying to trigger an event bridge rule:
{
"detail": {
"stateMachineArn": ["arn:aws:states:eu-west-2:<account-num>:stateMachine:<target-name>"],
"status": ["SUCCEEDED"]
},
"detail-type": ["detail-type"],
"source": ["aws.states"]
}
I'm trying to put an event to the default bus using the following step in my step-function:
"SendEventToEventBridge": {
"Type": "Task",
"Resource": "arn:aws:states:::events:putEvents",
"Parameters": {
"Entries": [
{
"Source": "aws.states",
"DetailType": "detail-type",
"Detail.$": "$.event",
"EventBusName": "default"
}
]
},
"End": true
}
But I keep getting a NotAuthorizedForSourceException when trying to upload this event in my step function using source 'aws.states'. From what I can tell it's because only AWS Service events can use sources 'aws.'. I thought sending an event from the step function as such would satisfy this condition but it seems not to. I'm struggling to understand, how do I send and event to the bus with the required source of 'aws.states' to satisfy the rule?