How to use AWS EventBridge Role Event Transformer
With the source event published on EventBridge as:
{
version: '0',
id: '1234-5678-9102-3456-7890',
'detail-type': 'My-Detail-Type',
source: 'My-Source',
account: '328927794502',
time: '2021-01-29T23:52:48Z',
region: 'us-east-1',
resources: [],
detail: { year: '2020' }
}
I go ahead and create the EventBridge Rule with the Target Transformer:
For the Input Path
I enter:
{"data_joined":"$.detail.year"}
And for the Input Template I enter:
{"Data-Joined" : <data_joined>}
Now when this event is transformed and sent to the destination (it could be Lambda function, CloudWatch Event log group and etc) I expect the transformed event to be:
{
version: '0',
id: '1234-5678-9102-3456-7890',
'detail-type': 'My-Detail-Type',
source: 'My-Source',
account: '328927794502',
time: '2021-01-29T23:52:48Z',
region: 'us-east-1',
resources: [],
detail: { Data-Joined: '2020' }
}
Unfortunately, this doesn't work as I am not able to find this transformed event anywhere. Is there anything I should be doing differently
There is a Note on the API_PutTargets page with regard to CloudWatch:
Note If your are using InputTransformer with CloudWatch Logs as a target, the Template must be {"timestamp":,"message":}.
In addition, I would assume that you already did it, but there is a Common Issues with Transforming Input