Search code examples
amazon-web-servicesamazon-ecsamazon-cloudwatchaws-event-bridge

AWS EventBridge ECS task status change event


I want to trigger a lambda function when a fargate task is deprovisionning, I created this EventBridge rule :

{
  "source": ["aws.ecs"],
  "detail-type": ["ECS Task State Change"],
  "detail": {
    "clusterArn": ["arn:aws:ecs:eu-west-3:xxx"],
    "lastStatus": ["DEPROVISIONING"]
  }
}

It does not seem to be working all the time, ie sometimes cloudwatch receives it and sometimes it doesn't (no logs are generated from the lambda function). What could cause this issue ?


Solution

  • So it seems the error was comming from my lambda function and because it was failing so often Event Bridge was blocking some of the calls of the lambda. Not that big of a deal afterall...