0

Is there any to automatically refresh the tasks of a service on a schedule (every day, every week, etc..)? Semi-officially, it seems like there may not be (and maybe it's just up to the individual processes to shut themselves down):

(https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-retirement.html)

A task can be scheduled for retirement in the following scenarios:

  • AWS detects the irreparable failure of the underlying hardware hosting the task.

  • Your task uses the Fargate launch type and is running on a platform version that has a security vulnerability that requires you to replace the tasks by launching new tasks using a patched platform version.

Dustin Oprea
  • 510
  • 1
  • 7
  • 19

1 Answers1

0

What you linked is when AWS retires tasks (for the reasons mentioned). However if you as a user wants to "refresh" your tasks and you don't have a new version of your task to be deployed (e.g. maybe because your change your image for a new app version deployment) you still have the option to force the redeployment of your service using the update-service API using the --force-new-deployment option.

Why would you want to do that out of curiosity?

mreferre
  • 426
  • 1
  • 5
  • They don't restart when you push a new image (and the task-definition is just tied to latest). It'd be nice if there were just a policy or scheduling mechanism that can handle a redeployment. Otherwise, we're ironically having to schedule an ECS task to do this for us. – Dustin Oprea May 29 '21 at 02:02
  • First, you should not use `latest` to deploy (in production). If you use latest and your service needs to scale out you would have different versions of your code running in your service. You should always use a tag that represent a specific build. Regardless of the tag you use, there is no automated mechanism to redeploy a service. This is something you need to configure in a pipeline. [See this for more details](https://docs.aws.amazon.com/codepipeline/latest/userguide/ecs-cd-pipeline.html). – mreferre May 29 '21 at 09:58