- Newest
- Most votes
- Most comments
Custom events are events that you generate in your application. I am not sure how you want to use custom events in this case. The only way I can think of is to create rules that catch the other, AWS, events, and then create a new custom event. If you do that anyway, why do you need the custom event, not to mention the extra cost and complexity.
You can combine multiple events into a single rule. For instance, the following rule will check if the event is EC2 instance change or ACM certificate expiration:
{
"source": ["aws.ec2"],
"detail-type": ["EC2 Instance State-change Notification", "ACM Certificate Approaching Expiration"]
}
You can also have more complex rules such as:
{
"$or": [
{
"detail-type": ["EC2 Instance State-change Notification"],
"detail": { "state": ["pending"] }
},
{
"detail-type": ["ACM Certificate Approaching Expiration"],
"detail": { "DaysToExpiry": [ { "numeric": [ "<", 10 ] } ] }
}
]
}
Yes, it is possible to have multiple patterns in a single event rule using AWS EventBridge. Each pattern can be associated with different event sources or services. In your case, you can create a single event rule with multiple patterns, such as one pattern for ACM Certificate Approaching Expiration and another pattern for EC2 Instance State-change Notification.
By using a single event rule with multiple patterns, you can consolidate the logic and actions within a single rule. This approach can simplify your event handling and reduce the number of separate rules you need to manage.
Regarding Custom Events, they are a feature of EventBridge that allows you to define your own custom events and publish them to the event bus. While Custom Events offer flexibility, they do incur additional costs. AWS default service events, on the other hand, are provided by AWS services and are generally free of cost.
If you prefer to avoid the additional cost associated with Custom Events, you can stick with using the default service events provided by AWS services like ACM and EC2. By combining multiple patterns within a single event rule, you can achieve your desired functionality efficiently.
Relevant content
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
Thank you Uri!!