Amazon ECS
List services in an Amazon ECS cluster
Read service ARNs in one ECS cluster and optionally describe a bounded set of those services for deployment metadata.
Documentation reviewed · 2 methods with sources
Ways to do it
API
ListServices
List service ARNs in a cluster with launch-type and pagination controls.
Read source: ListServices reference- Requirements
- AWS credentials with ecs:ListServices on the cluster, a region, and a cluster name or ARN.
- Limitations
- Without maxResults, ListServices returns up to 10 results and a nextToken. maxResults accepts 1 to 100. Call DescribeServices separately when deployment metadata is needed.
Example json
{"cluster":"$ECS_CLUSTER","maxResults":100}CLI
aws ecs list-services
List service ARNs from the AWS CLI with a bounded page size.
Read source: aws ecs list-services reference- Requirements
- AWS CLI configured for the target account and region, and ecs:ListServices permission.
- Limitations
- --max-items limits the CLI pagination wrapper and --page-size controls service calls. This command reads service identifiers only.
Example shell
aws ecs list-services --cluster "$ECS_CLUSTER" --max-items 100 --output json