- Newest
- Most votes
- Most comments
Hi,
You can use the below pattern which you can pretty much construct from the console (screenshot below) using the predefined values.
{
"source": ["aws.health"],
"detail-type": ["AWS Health Event"],
"detail": {
"service": ["ECS"],
"eventTypeCategory": ["scheduledChange"],
"eventTypeCode": ["AWS_ECS_TASK_PATCHING_RETIREMENT", "AWS_ECS_TASK_RETIREMENT_SCHEDULED"]
}
}
I think the below should work (in raw event pattern syntax for EventBridge). Note that you'll need the EventBridge rule separately in every region where you have ECS tasks.
{
"detail-type": ["AWS Health Event"],
"detail": {
"service": ["ECS"],
"eventTypeCode": ["AWS_ECS_TASK_RETIREMENT_SCHEDULED", "AWS_ECS_TASK_PATCHING_RETIREMENT"]
}
}
Thank you. Trying to compare and know the reason my event pattern above didn't work. Is the reason because the "source" value should not be "aws.health"?
I don't know which region your ECS tasks are in, but you never need to filter based on
region, because ECS only emits the events in the region where the tasks reside. Your events wouldn't arrive if your EventBridge rule is in a different region from ECS, or if the rule is attached to an event bus other than the default event bus, or if theregionfilter in the event pattern doesn't match the region of the ECS tasks and the EventBridge rule. In general, I'd prefer to keep only the essential fields in the filter, to make it easier to read and troubleshoot.@Leo K Thanks for explanation, will try your example
Relevant content
asked 3 years ago
- AWS OFFICIALUpdated a month ago

Thank you for suggestion, I see both your example and Leo K example does not have region, perhaps that is my mistake in my EventPattern, I will compare and try out