1 Answer
- Newest
- Most votes
- Most comments
1
For EventBridge service to capture events with a detail-type value of AWS API Call via CloudTrail
, a CloudTrail trail with logging enabled is required. As long as there is a single trail among many trails configured in your account which has logging enabled, CloudTrail service publish events to EventBridge default event bus which can be captured via EventBridge rule with a detail-type value of AWS API Call via CloudTrail
. Please refer to Accessing AWS service events via AWS CloudTrail for more information in this regard.
Answering specifically to your queries above:
- How to define a specific trail?
- It is neither required nor it is part of the CloudTrail events with a detail-type value of
AWS API Call via CloudTrail
. Hence, you do not need to define a specific trail.
- If there's no way to do it, can you please describe how AWS determines which trail is used when there are several different ones?
- As mentioned above, as long as there is a single trail among many trails configured in your account which has logging enabled, CloudTrail service publish events to EventBridge default event bus which can be captured via EventBridge rule with a detail-type value of
AWS API Call via CloudTrail
.
answered 8 months ago
Relevant content
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
Hi. This is not supported yet (it could be supported in future). Eventbridge rules for CloudTrail are compared against the event itself (event data) but the event does not have data regarding the trail name/identifier, so you cant create a rule for events from a specific trail. The best you can do is to make use of any event data that is different for events in each trail i.e, what criteria did you use to differentiate your events for each trail?