Use actual ECS task definition file, drop name req#8
Use actual ECS task definition file, drop name req#8Tom Shawver (TomFrost) wants to merge 1 commit into
Conversation
Previously the task definition file required by this step was actually just an array of container defintions -- one of three main sections of a task definition. This commit reads the task definition file as a full ECS task definition, including keys for the family name and the optional 'volumes' section. Since the family is now defined in this file, the need to specify the family as an argument in this step has been eliminated, and so that argument has been removed.
|
Hey I checked you PR and I would like to integrate it ASAP but I merged another PR since. Could you rebase your branch please? |
|
Hello, When it will to merge with this fix? Thanks! |
|
Hi there! Sorry, I no longer use this codebase (nor Wercker) and I am no longer part of the org under which I originally opened this PR. Others are welcome to take over my contribution, but I'm unable to maintain it. With that said, however: The main point of this script is to automate the downscaling/upscaling of ECS service tasks to roll out a new task definition, however ECS has since been updated to handle this itself. When defining an ECS cluster, you can now specify the percentage of instances that must stay online as the new version cycles in, as well as the number of extra instances over the desired amount that can be launched during this process. This eliminates the need to automate a scale down/scale up, and the AWS CLI tool can read a full task json file and upload it as a new revision to an existing task. That reduces this entire script to two calls with the AWS CLI: One to upload the new task definition, and another to update the service to use the new revision. Here's a sample of how I'm doing it now. I recommend creating a file named envsubst < ${ECS_TASK_TEMPLATE} > ${ECS_TASK_JSON}
RESULT=`aws --region ${AWS_REGION} ecs register-task-definition --cli-input-json file://${ECS_TASK_JSON} --output json`
TASK_ARN=`echo ${RESULT} | json taskDefinition.taskDefinitionArn`
aws --region ${AWS_REGION} ecs update-service --cluster ${ECS_CLUSTER} --service ${ECS_SERVICE} --task-definition ${TASK_ARN} --output jsonRequired env vars: All this assumes that your ecs_task.json has the appropriate fields to determine which task to upload to. |
Previously the task definition file required by this step was actually just an array of container definitions -- one of three main sections of a task definition. This commit reads the task definition file as a full ECS task definition, including keys for the family name and the optional 'volumes' section which previously couldn't be defined in this step at all. Since the family is now defined in this file, the need to specify the family as an argument in this step has been eliminated, and the argument has been removed.