I currently have a lambda function in AWS that I am trying to trigger whenever a new event is detected by Cloudtrail. In Amazon EventBridge, I have set a rule with the following event pattern:
{
"source": ["aws.cloudtrail"]
}
I have also configured the target to be the lambda function. However, when I go to AWS WAF -> IP SETS, and edit one of the IP Sets, even though I can see the event in the Event History tab of cloudtrail, the lambda function does not get triggered. I have checked the event JSON in cloudtrail and the eventSource
property is given as wafv2.amazonaws.com
. Should I take this to mean that my rule in eventbridge is not working as the source is never going to be cloudtrail itself, but the service that the change actually occurs in? If so, is there any other way I could possibly configure an eventbridge rule such that any event detected by cloudtrail will trigger the lambda? (I need the lambda function to be triggered on a variety of events, not just updating IP sets, so I can't set the source as WAF)