- Newest
- Most votes
- Most comments
First, do make sure you have at least one CloudTrail trail enabled (you should double-check but I believe first trail is always free). Otherwise CloudTrail will not be passing events to EventBridge.
After that, I'd recommend creating a more generic rule to grab a sample event that you like. You can forward this to a temporary CloudWatch Log record. Once you have a sample event, you can follow this guide to test your event-pattern https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-pattern-sandbox.html.
Hello.
Change "detail-type" to "AWS Service Event via CloudTrail" as shown in the stackoverflow answer below.
https://stackoverflow.com/questions/70603754/amazon-eventbridge-rotation-succeeded-event
{
"detail-type": [
"AWS Service Event via CloudTrail"
],
"detail": {
"eventSource": [
"secretsmanager.amazonaws.com"
],
"eventName": [
"RotationSucceeded"
]
}
}
I think the event pattern in the following document will be helpful.
https://docs.aws.amazon.com/secretsmanager/latest/userguide/monitoring-eventbridge.html#monitoring-eventbridge_examples-rotations
{
"source": ["aws.secretsmanager"],
"$or": [
{ "detail-type": ["AWS API Call via CloudTrail"] },
{ "detail-type": ["AWS Service Event via CloudTrail"] }
],
"detail": {
"eventSource": ["secretsmanager.amazonaws.com"],
"eventName": ["PutSecretValue", "UpdateSecret", "RotationSucceeded"]
}
}
Tried the above solutions but still facing the same issue. In Cloud Watch metrics unable to see event by eventbridge rule name. Even Failed Invocation is not present. I am guessing the eventbridge rule was never invoked and hence the target SNS topic and the Lambda Functions were not triggered. There is some issue with the event pattern because Lambda is getting invoked by a different unrelated rule that i used for testing. It had similar permissions.
Relevant content
- Accepted Answerasked 5 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 7 months ago
- Why can't I view the EventBridge trigger in my Lambda function that my CloudFormation stack created?AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 8 months ago
Thanks Mr. baldawar. I have created a trail in cloudtrail and an S3 Bucket along with it to store the event logs. After that Issue got resolved. Also I used below event pattern in eventbridge rule :
{ "source": ["aws.secretsmanager"], "detail-type": ["AWS Service Event via CloudTrail"], "detail": { "eventSource": ["secretsmanager.amazonaws.com"], "eventName": ["RotationSucceeded"] } }