Difference between revisions of "Aws ecs list-services"

From wikieduonline
Jump to navigation Jump to search
Line 4: Line 4:
  
 
  [[aws ecs]] list-services --cluster [[your-cluster]]
 
  [[aws ecs]] list-services --cluster [[your-cluster]]
 +
 +
 +
aws ecs list-services --cluster [[your-cluster]] | grep . |  cut -d":" -f6- | cut -d'"' -f1 | cut -d"/" -f3
  
 
  aws ecs list-services --cluster [[your-cluster]] | grep YOUR-TEXT | grep . |  cut -d":" -f6- | cut -d'"' -f1 | cut -d"/" -f3
 
  aws ecs list-services --cluster [[your-cluster]] | grep YOUR-TEXT | grep . |  cut -d":" -f6- | cut -d'"' -f1 | cut -d"/" -f3

Revision as of 10:46, 24 April 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 . |  cut -d":" -f6- | cut -d'"' -f1 | cut -d"/" -f3
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

Advertising: