Tell us about your request
Would like to be able to configure deployment controller for an ECS service via cloudformation to make use of EXTERNAL deployment controller without having to specify an initial task definition. Currently this is only possible via the CLI.
Which service(s) is this request for?
ECS
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
When provisioning an ECS Service via cloudformation, it defaults to using the ECS deployment controller and thus forces you to specify a task definition (among other parameters) despite the documentation hinting at otherwise.
"A task definition must be specified if the service is using the ECS deployment controller."
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html
"To manage an Amazon ECS service using an external deployment controller....Create an Amazon ECS service. The only required parameter is the service name."
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-external.html
Are you currently working around this issue?
Creating ECS Service with CLI
eg:
aws ecs create-service --service-name test-service --deployment-controller type=EXTERNAL --desired-count 1 --cluster test-cluster
(Despite documentation saying the only required parameter is the service name, the CLI requires you to give desired count as well).
It should also allow something like the below for bluegreen deployment with codedeploy in cloudformation templates
"deploymentController": {
"type": "CODE_DEPLOY"
},
+1
+1
+1
I have tried to create Custom CloudFormation for Blue Green ECS Service and well as Blue/Green ECS DeploymentGroup in this Repo https://github.com/BalmanRawat/bgECSService. Comments/Issues are highly welcome.
where's the Cloudformation repo I'll put in a PR! ;)
"DeploymentController" is now available as a property in CloudFormation. Both "EXTERNAL" and "CODE_DEPLOY" values are supported.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-deploymentcontroller.html
For the "EXTERNAL" deployment controller type, TaskSet and PrimaryTaskSet resource types are also now available in CloudFormation:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_ECS.html
Are there already some examples?
@pgarbe There's an example here:
https://github.com/aws-samples/aws-reinvent-2019-trivia-game/blob/master/trivia-backend/infra/cfn-task-sets/template.yaml#L39-L76
The documentation explains the 3 controllers, but documented at the bottom it still states:
Allowed Values: ECS | EXTERNAL
@clareliguori Can you please confirm that Deployment Controller CODE_DEPLOY does not create application and deployment group for ECS Service in CodeDeploy?
Correct @CONJAUMCGCG, CODE_DEPLOY deployment controller setting on the ECS service does not create the CodeDeploy resources (application, deployment group); they need to be created separately. There is a CloudFormation roadmap issue that is tracking support for the "ECSServices" attribute in the CodeDeploy deployment group resource type here:
https://github.com/aws-cloudformation/aws-cloudformation-coverage-roadmap/issues/483
@clareliguori
Thank you. So neither we can use CODE_DEPLOY deployment controller nor create deployment groups ourselves, the only way is to use https://www.npmjs.com/package/@cloudcomponents/cdk-blue-green-container-deployment
Most helpful comment
It should also allow something like the below for bluegreen deployment with codedeploy in cloudformation templates