I have a ECS service (blue/green) and i would like to exec containers then i tried to enable the EnableExecuteCommand
in this service using aws cli:
aws ecs update-service --cluster **** --task-definition **** --service **** --enable-execute-command
but im getting:
An error occurred (InvalidParameterException) when calling the UpdateService operation: Unable to update task definition on services with a CODE_DEPLOY deployment controller. Use AWS CodeDeploy to trigger a new deployment.
it tell to create a new deployment but this does not make sense, i searched alot in google but can't find any solution, maybe it is not possible ? cuz the blue/green is managed by aws codedeploy ?
I found in aws docs this:
For services using the blue/green (CODE_DEPLOY) deployment controller, only the desired count, deployment configuration, health check grace period, task placement constraints and strategies, enable ECS managed tags option, and propagate tags can be updated using this API. If the network configuration, platform version, task definition, or load balancer need to be updated, create a new AWS CodeDeploy deployment. For more information, see CreateDeployment in the AWS CodeDeploy API Reference.
https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_UpdateService.html
I thought maybe i could set it in taskdef.json but there is no EnableExecuteCommand property.
Could someone give me some hint?
Thanks in advanced.
Unfortunately there's no way currently to enable that setting for an ECS service once it is configured to use CodeDeploy.
This tutorial for ECS and CodeDeploy shows creating the service first, before using CodeDeploy with the service. At the point of creating the service, you could enable the ECS Exec setting.