Skip to content

How can I leave prev task definition as activate status. #5300

Answered by Lou1415926
jed-glorang asked this question in Q&A
Discussion options

You must be logged in to vote

Yup! You can use yaml patch to update the TaskDefinition's UpdateReplacePolicy to Retain:

- op: add
  path: /Resources/TaskDefinition/UpdateReplacePolicy
  value: Retain

Edit: I will add a bit explanation on why this would work.

The task definition became INACTIVE because when CFN updates the stack, it under the hood CREATE a task definition with a new revision, and DELETE the old task definition revision. In this case, "delete" means "deregistering" the old task def, resulting in the old task def revision becoming INACTIVE.

By adding UpdateReplacePolicy: Retain, we prevent CFN to do the "delete" step, hence keeping the old task def as ACTIVE.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@jed-glorang
Comment options

@Lou1415926
Comment options

@shanmukhabandi
Comment options

@jed-glorang
Comment options

Answer selected by jed-glorang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants