AWS ECS
Version baseline: AWS CLI v2, using the latest stable v2 patch available for the host platform (2.36.x at this review). Reject AWS CLI v1-only behavior and inspect aws --version plus the live v2 command help before composing commands.
Identify the cluster, service, task family, launch type, region, and deployment before changing anything. Keep ECS control-plane state separate from application logs and load-balancer health.
Inspect first
aws ecs list-clusters --profile PROFILE --region REGION
aws ecs describe-clusters --clusters CLUSTER --include ATTACHMENTS,CONFIGURATIONS,STATISTICS,TAGS --profile PROFILE --region REGION
aws ecs list-services --cluster CLUSTER --profile PROFILE --region REGION
aws ecs describe-services --cluster CLUSTER --services SERVICE --profile PROFILE --region REGION
aws ecs list-tasks --cluster CLUSTER --service-name SERVICE --desired-status RUNNING --profile PROFILE --region REGION
aws ecs describe-tasks --cluster CLUSTER --tasks TASK_ARN --include TAGS --profile PROFILE --region REGION
aws ecs describe-task-definition --task-definition FAMILY_OR_ARN --profile PROFILE --region REGION
Check desired, running, and pending counts; deployment IDs and rollout state; task stop reasons; container exit codes; image digests; environment and secret references without printing values; health checks; capacity provider; networking; and load-balancer target health when relevant.
Diagnose a service
- Confirm the service points at the expected task definition revision.
- Inspect recent events and stopped tasks before forcing a deployment.
- Separate image pull or execution-role failures from application exits, health-check failures, capacity shortages, and network reachability.
- Compare the task’s container port, target group, security groups, subnets, and listener path only with evidence.
- Follow the configured log driver to the correct CloudWatch log group and stream prefix.
Mutations
update-service, force-new-deployment, stop-task, task-definition registration, scaling changes, and cluster capacity changes are mutating. Explain downtime, replacement, cost, and rollback implications. Never stop every task or force a rollout to clear an unexplained failure.
After an approved change, verify deployment stability, task health, service events, target health, logs, and the original endpoint or job behavior. If the failure is primarily an image problem, hand off to 11ai-operator-aws-cli-v2-ecr; if it is primarily logs or metrics, use 11ai-operator-aws-cli-v2-cloudwatch.