I am using AW Lambda, which consumes ECS task events. Based on task state change event I need to get the corresponding service (ECS service name).
Right now I use Task Group to retrieve it, but I’ve found that it does not work for all of the tasks (some tasks have groups with ‘family’ prefix). Also going through all services and checking their tasks is not an option (there are a lot of services and Lambda has a few seconds timeout).
I saw that apparently task definition ARN contains service name, but I am not sure that it is the rule for AWS ARN generation (could not find any docs), but rather some custom definition ARN generation (which won’t apply to all of the tasks). What would be the best approach in this situation?
1