aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

ECS Task Definiton - Update of Task Definition not captured by Drift Detection

Open
#1,056 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### Name of the resource

AWS::ECS::TaskDefinition

### Resource name

_No response_

### Description

We have a Stack that includes API, ECS Service and Task Def

We have come across an issue where using the Family Parameter to update ECS Task Definition, the task definition is managed by CFN to replace the task AND keep the old Task Revision as inactive.

If you run Drift Detection against the Stack then Drift Detection always checks against the first revision of the task but show as not drifted.

If you have an ECS Service that calls the Task Definition Stack it will show as drifted even though a stack update will update the service with the most up to date Task Definition.

This does not make sense because CFN can handle the Revision update but Drift Detection does not. This will Create scenarios when old config could be re-introduced.

The screenshot shown has handled 7 revisions without issue but will always show drift because it checks against the 1st revision.

![Screenshot 2022-02-01 at 10 37 51](https://user-images.githubusercontent.com/32636070/151954556-158ae9dd-a568-449f-85ff-fda45adcbcfe.jpeg)

### Other Details

Update - we have just isolated that we noticed this on a stack that had manual drift, other stacks behaved differently and the faulty stack worked fine until the drift.

It's like manual intervention resets the drift detection

Contributor guide

Open the contributing guide

Research direction

No repository files, tests, or code entry points are mentioned. Start by reproducing drift detection for AWS::ECS::TaskDefinition after Family-based revisions and after manual drift; done means detection evaluates the current task definition revision consistently with the ECS service and stack update behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.