AWS ECS container orchestration for running Docker containers. Use when deploying containerized applications, configuring task definitions, setting up services, managing clusters, or troubleshooting container issues.
View on GitHubitsmostafa/aws-agent-skills
aws-agent-skills
January 14, 2026
Select agents to install to:
npx add-skill https://github.com/itsmostafa/aws-agent-skills/blob/main//skills/ecs/SKILL.md -a claude-code --skill ecsInstallation paths:
.claude/skills/ecs/# AWS ECS
Amazon Elastic Container Service (ECS) is a fully managed container orchestration service. Run containers on AWS Fargate (serverless) or EC2 instances.
## Table of Contents
- [Core Concepts](#core-concepts)
- [Common Patterns](#common-patterns)
- [CLI Reference](#cli-reference)
- [Best Practices](#best-practices)
- [Troubleshooting](#troubleshooting)
- [References](#references)
## Core Concepts
### Cluster
Logical grouping of tasks or services. Can contain Fargate tasks, EC2 instances, or both.
### Task Definition
Blueprint for your application. Defines containers, resources, networking, and IAM roles.
### Task
Running instance of a task definition. Can run standalone or as part of a service.
### Service
Maintains desired count of tasks. Handles deployments, load balancing, and auto scaling.
### Launch Types
| Type | Description | Use Case |
|------|-------------|----------|
| **Fargate** | Serverless, pay per task | Most workloads |
| **EC2** | Self-managed instances | GPU, Windows, specific requirements |
## Common Patterns
### Create a Fargate Cluster
**AWS CLI:**
```bash
# Create cluster
aws ecs create-cluster --cluster-name my-cluster
# With capacity providers
aws ecs create-cluster \
--cluster-name my-cluster \
--capacity-providers FARGATE FARGATE_SPOT \
--default-capacity-provider-strategy \
capacityProvider=FARGATE,weight=1 \
capacityProvider=FARGATE_SPOT,weight=1
```
### Register Task Definition
```bash
cat > task-definition.json << 'EOF'
{
"family": "web-app",
"networkMode": "awsvpc",
"requiresCompatibilities": ["FARGATE"],
"cpu": "256",
"memory": "512",
"executionRoleArn": "arn:aws:iam::123456789012:role/ecsTaskExecutionRole",
"taskRoleArn": "arn:aws:iam::123456789012:role/ecsTaskRole",
"containerDefinitions": [
{
"name": "web",
"image": "123456789012.dkr.ecr.us-east-1.amazonaws.com/my-app:latest",
"portMappings": [
{
"containerPort": 8080,
"prot