aws-ecs
TLDR
List all ECS clusters
SYNOPSIS
aws ecs subcommand [options]
DESCRIPTION
aws ecs is a subcommand of the AWS CLI that manages Amazon Elastic Container Service, a fully managed container orchestration service. ECS runs Docker containers on a cluster of EC2 instances or serverless with Fargate.
The core concepts are: clusters (logical grouping of resources), task definitions (blueprints for containers), tasks (running instances of task definitions), and services (maintain desired count of tasks). ECS integrates with load balancers, auto scaling, and IAM for production workloads.
ECS Exec enables interactive shell access to running containers for debugging, similar to docker exec but through the SSM agent.
PARAMETERS
list-clusters
List all ECS clusters in the region.describe-clusters
Get detailed information about clusters.create-cluster
Create a new ECS cluster.delete-cluster
Remove an empty cluster.list-services
List services running in a cluster.describe-services
Get service details, deployments, and events.create-service
Create a new service.update-service
Modify service configuration or trigger deployment.delete-service
Remove a service from the cluster.list-tasks
List tasks in a cluster or service.describe-tasks
Get task details and container status.run-task
Start a standalone task.stop-task
Terminate a running task.execute-command
Run interactive command in a container.register-task-definition
Create a new task definition revision.--cluster name
Target cluster name or ARN.--service name
Target service name or ARN.--task-definition name:revision
Task definition family and revision.--desired-count number
Number of task instances to run.--force-new-deployment
Force service to pull new image and redeploy.
CAVEATS
Deleting a cluster requires stopping all tasks and deleting all services first. Task definitions cannot be deleted, only deregistered. ECS Exec requires the SSM agent and proper IAM permissions on the task role. Fargate tasks must specify CPU and memory at the task level.
HISTORY
Amazon ECS was announced at AWS re:Invent 2014 and launched in April 2015 as AWS's first container orchestration service. Fargate serverless compute was added in November 2017. ECS Exec for interactive debugging was introduced in March 2021. The service continues to evolve alongside AWS's container strategy including integration with EKS.


