Difference between revisions of "Aws ecs list-services"
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
[[aws ecs]] list-services --cluster [[your-cluster]] | [[aws ecs]] list-services --cluster [[your-cluster]] | ||
− | aws ecs list-services --cluster [[your-cluster]] | grep YOUR-TEXT | grep . | cut -d":" -f6- | cut -d'"' -f1 | + | aws ecs list-services --cluster [[your-cluster]] | grep YOUR-TEXT | grep . | cut -d":" -f6- | cut -d'"' -f1 | cut -d"/" -f3 |
aws ecs list-services | aws ecs list-services | ||
Line 12: | Line 12: | ||
Stop services: | Stop services: | ||
− | [[for]] SERVICES in $(aws ecs list-services --cluster [[your-cluster]] | grep YOUR-TEXT | grep . | cut -d":" -f6- | cut -d'"' -f1); do | + | [[for]] SERVICES in $(aws ecs list-services --cluster [[your-cluster]] | grep YOUR-TEXT | grep . | cut -d":" -f6- | cut -d'"' -f1 | cut -d"/" -f3); do |
[[aws ecs update-service --cluster]] [[your-cluster]] --service $SERVICES [[--desired-count]] 0; done | [[aws ecs update-service --cluster]] [[your-cluster]] --service $SERVICES [[--desired-count]] 0; done | ||
Revision as of 10:26, 21 March 2023
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ecs/list-services.html
aws ecs list-services --cluster your-cluster
aws ecs list-services --cluster your-cluster | grep YOUR-TEXT | grep . | cut -d":" -f6- | cut -d'"' -f1 | cut -d"/" -f3
aws ecs list-services An error occurred (ClusterNotFoundException) when calling the ListServices operation: Cluster not found.
Stop services:
for SERVICES in $(aws ecs list-services --cluster your-cluster | grep YOUR-TEXT | grep . | cut -d":" -f6- | cut -d'"' -f1 | cut -d"/" -f3); do aws ecs update-service --cluster your-cluster --service $SERVICES --desired-count 0; done
Related
See also
- AWS ECS:
aws ecs [ create-cluster | create-service | update-service | list-clusters | list-services | describe-cluster | describe-services | describe-tasks | put-account-setting | execute-command | run-task ]
- Amazon ECS, Service, Tasks (Task overview), capacity providers, Cluster Auto Scaling (CAS),
aws ecs, ecs-cli, ~/.ecs/config
, AWS Copilot, AWS Fargate, AWS CloudWatch Container Insights,/etc/ecs/ecs.config
, Security group (SG), container agent, task definition, Amazon ECS events, best practices, Amazon ECS Exec Checker, Amazon ECS Agent, Service Connect,AWSServiceRoleForECS
, Terraform ECS, AWS ECS Rolling deployments
Advertising: