I have a pipeline setup to an ecs cluster in which I update the services' task definition and then launch a new deploy. E.g.:
# Update task definition
- aws ecs register-task-definition --cli-input-json file://aws/task-definition${TASK_SUFFIX}.json --region $AWS_DEFAULT_REGION
- TASK_REVISION=`aws ecs describe-task-definition --task-definition ${SERVICE_NAME}${TASK_SUFFIX} | egrep "revision" | tr "/" " " | awk '{print $2}' | sed 's/"$//'`
# Request service update:
- aws ecs update-service --service ${SERVICE_NAME} --cluster ${CLUSTER_NAME} --task-definition ${SERVICE_NAME}${TASK_SUFFIX}:${TASK_REVISION} --force-new-deployment
I have a scheduled task that uses the same task definition of a service, both using fargate. However, when I update my service's task definition, I have to manually update my scheduled task to the latest revision.
I would like to update my scheduled task's task definition to the latest revision whenever I update my service's task definition. Is it possible?