I have event from event bus rule. Below is an example without adding input transformer.
{
"input":{
'version': '0',
'id': '12345',
'detail-type': 'abcd',
'source': 'aws',
'region': 'us-east-1',
'detail': {
'account_id': 123456,
'customer': 'some customer'
}
},
"inputDetails"{
"truncated":False
}
The event will be sent to a lambda function of a state machine. I use the following code to define the input transformer (only need the customer_name, not a constant value) for the state machine but I can't figure it out the right way to do it.
targets=lambda: [aws_events_targets.SfnStateMachine(
machine=my_state_machine.get(),
input=aws_events.RuleTargetInput.from_object(
{"customer": "$.input.detail.customer"}
),
)],
Here is the result I figured out.