- Newest
- Most votes
- Most comments
Hello xerphigh,
It is currently not possible to update the ECS service load balancer configurations using the ECS console. However, you can use the update-service CLI operation to perform the update.
You can use the below command to update the target group associated with your ECS service by passing the containerName
, containerPort
, and targetGroupArn
values using the --load-balancers
flag.
aws ecs update-service --cluster <cluster-name> --region <region> --service <ecs-service-name> --load-balancers '
[{
"containerName": "<container-name>",
"containerPort": <container-port>,
"targetGroupArn": "<target-group-arn>"
}]
'
I hope this helps!
Unknown option --load-balancers Did the syntax change ? $ aws ecs update-service --cluster shopping_cart-ecs-cluster --region ap-southeast-1 --service shopping_cart --load-balancers ' [{ "containerName": "shopping_cart", "containerPort": 8070, "targetGroupArn": "arn:aws:elasticloadbalancing:ap-southeast-1:325842618176:targetgroup/shopping-cart-tg/4dc345363556433" }] ' To see help text, you can run:
aws help aws <command> help aws <command> <subcommand> help
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
Unknown options: --load-balancers, [{ "containerName": "shopping_cart", "containerPort": 8070, "targetGroupArn": "arn:aws:elasticloadbalancing:ap-southeast-1:325842618176:targetgroup/shopping-cart-tg/4dc345363556433" }]
Relevant content
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 3 months ago
Agree, or re-create service.. Via CLi you can also add a 2nd TG to an ECS Service too