- Newest
- Most votes
- Most comments
Hello.
Do you have a CloudTrail trail enabled in the region where your Cognito user pool is configured?
I tried the EventBridge rule you created in my AWS account, but EventBridge was not triggered unless a CloudTrail trail was enabled.
https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-a-trail-using-the-console-first-time.html
Cloudtrail is always on but does eventbridge require a trail to be configured? I didnt think it did
Yes. CloudTrail won't deliver events to EventBridge, unless a trail logging at least the desired events is configured in the region. The default CloudTrail event history doesn't count as a trail.
In my testing, I found that a CloudTrail trail had to be enabled in order for EventBridge to catch the "AdminCreateUser" event.
There are several potential reasons why your EventBridge rule isn't capturing Cognito events despite them appearing in CloudTrail. Let me help you troubleshoot:
-
Your event pattern looks correct for capturing Amazon Cognito user pool events. The source "aws.cognito-idp" and eventSource "cognito-idp.amazonaws.com" are the proper values for matching Cognito user pool events.
-
To specifically target user creation events, you might want to add the "eventName" field to your pattern:
{
"source": ["aws.cognito-idp"],
"detail-type": ["AWS API Call via CloudTrail"],
"detail": {
"eventSource": ["cognito-idp.amazonaws.com"],
"eventName": ["AdminCreateUser"]
}
}
-
Check if your rule is in the "ENABLED" state. Disabled rules won't match any events.
-
Verify that you've created the rule in the correct AWS region. Some AWS services may only send events to EventBridge in specific regions.
-
Ensure that EventBridge has the necessary permissions to access the events and invoke your Lambda function.
-
Allow some time for newly created or modified rules to become fully operational. There can sometimes be a slight delay.
-
Verify that your CloudTrail trail is properly configured to send events to EventBridge.
-
Check CloudWatch metrics for your EventBridge rule, such as "TriggeredRules" and "FailedInvocations" to get more insight into what's happening.
If the issue persists, consider setting up a dead-letter queue (DLQ) to capture any failed event deliveries for further analysis.
Sources
Amazon Cognito user pools events - Amazon EventBridge
Need some help with my setting(EventBridge) | AWS re:Post
EventBridge rule not triggered | AWS re:Post
Troubleshooting Amazon EventBridge - Amazon EventBridge
This works perfectly for me.
Make sure the role has access to the Target etc Also note, it can take a few mins for the rule to become active after you have created it.
{
"detail-type": ["AWS API Call via CloudTrail"],
"source": ["aws.cognito-idp"],
"detail": {
"eventName": ["AdminCreateUser"],
"eventSource": ["cognito-idp.amazonaws.com"]
}
}
Relevant content
- AWS OFFICIALUpdated a month ago

Rule looks good. Have you tried to use CW logs as a target? To discard whether there is something wrong when invoking your function.