Updating rather than replacing ECS Task Definition with CloudFormation


When updating a TaskDefinition in CloudFormation the docs say that a replacement action occurs –

Is there a way to get that to be a new revision? Should I be using the family parameter? Is there a TaskDefinition limit? Otherwise I end up with a large number of inactive definitions.


Yes, in order to put your changes in a new revision of the same Task Definition you should use the Family parameter. Quoting from the official documentation:


The name of a family that this task definition is registered to. A
family groups multiple versions of a task definition.

CloudFormation will still consider this a “replacement” and will delete the old revision, however it will not create a new Task Definition if you use the Family parameter.

Leave a Reply