I have an Eventbridge rule which trigger a lambda function every time a task crashed in the cluster PRODUCTION
.
The issue is that I want to monitor only tasks running in the specific service backendPRODUCTION
.
I didn't find any template specifying an ECS service with Eventbridge. How can I trigger my lambda function only for tasks running in the specific service backendPRODUCTION
?
Thanks in advance!
{
"source": ["aws.ecs"],
"detail-type": ["ECS Task State Change", "ECS Container Instance State Change"],
"detail": {
"clusterArn": ["arn:aws:ecs:eu-west-3:xxxxxxxxxxxx:cluster/PRODUCTION"],
"lastStatus": [
"STOPPED"
],
"stoppedReason": [
"Essential container in task exited"
]
}
}