- Newest
- Most votes
- Most comments
The command, aws ecs update-service --service my-service --cluster my-cluster --deployment-configuration "deploymentCircuitBreaker={enable=true,rollback=true}" --deployment-controller type=CODE_DEPLOY, as written won't work for two important reasons:
Circuit Breaker Configuration Issue: Deployment circuit breakers are not supported when using CODE_DEPLOY as the deployment controller type. You'll need to remove the circuit breaker configuration from your command.
Deployment Controller Limitation: If your service is currently using ECS as the deployment controller, you cannot switch to CODE_DEPLOY using update-service. Instead, you'll need to create a new service.
Here's the recommended solution: Create a new service using the following command structure:
aws ecs create-service \
--service-name <your-service-name> \
--cluster <your-cluster-name> \
--task-definition <task-definition-name> \
--deployment-controller type=CODE_DEPLOY \
--desired-count 1 \
--launch-type FARGATE|EC2|EXTERNAL \
--load-balancers '[{
"targetGroupArn": <target-group-arn>,
"containerName": <container-name>,
"containerPort": 80
}]' \
--network-configuration 'awsvpcConfiguration={
subnets=[<subnet-1>,<subnet-2>,<subnet-3>],
securityGroups=[<security-group>],
assignPublicIp="DISABLED|ENABLED"
}'
Please replace the bracketed values with your specific configuration details. This approach will create a new service properly configured for CODE_DEPLOY deployments.
The error you're seeing is because the ECS Service must be configured to use CODE_DEPLOY as the deployment controller. This configuration is not done in the ECS Service console, but rather when you're creating or updating an ECS Service via AWS CLI or SDK.
Here are the steps you can follow:
- Update the ECS Service to use CodeDeploy as the deployment controller:
You can do this through the AWS CLI. The command to update the ECS service would look like this:
aws ecs update-service --service my-service --cluster my-cluster --deployment-configuration "deploymentCircuitBreaker={enable=true,rollback=true}" --deployment-controller type=CODE_DEPLOY
In this command:
- Replace
my-servicewith the name of your service. - Replace
my-clusterwith the name of your cluster.
This command will switch the deployment controller to CodeDeploy for your specified service.
- Create a CodeDeploy Application:
You would need to create a CodeDeploy application that is configured to use the ECS compute platform.
- Create a Deployment Group:
Within the CodeDeploy application, you create a deployment group. You'll need to specify the service and cluster name of your ECS service and the load balancer or target group if any.
- Create a AppSpec file:
For ECS deployments, the AppSpec file is used to specify the updated task definition and container to use in the deployment.
- Create a Deployment:
You can then create a deployment that references your AppSpec file.
Remember to have the necessary IAM roles and permissions set up for CodeDeploy to access ECS and any other necessary resources.
Please accept it as the correct answer if you find it helpful.
Relevant content
- asked a year ago
- AWS OFFICIALUpdated a year ago

Hi there
I got this when I tried #1:
daveed@daveeds-air Downloads % aws ecs update-service --service meta-ordinals --cluster Meta-ordinals --deployment-configuration "deploymentCircuitBreaker={enable=true,rollback=true}" --deployment-controller type=CODE_DEPLOY
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run:
aws help aws <command> help aws <command> <subcommand> help
Unknown options: --deployment-controller, type=CODE_DEPLOY
@Daveed , did you fix it ?