ECS Cluster ARN — Container Orchestration Resources
Parse an Amazon ECS cluster ARN and understand how ECS services, tasks, and container instances are identified. Covers the ECS ARN hierarchy.
Detailed Explanation
ECS Resource ARN Hierarchy
Amazon ECS uses a hierarchical system of ARNs for clusters, services, tasks, and container instances. The cluster ARN is the top-level resource.
Example ARN
arn:aws:ecs:us-east-1:123456789012:cluster/production-web
Parsed Components
| Component | Value |
|---|---|
| Partition | aws |
| Service | ecs |
| Region | us-east-1 |
| Account ID | 123456789012 |
| Resource Type | cluster |
| Resource ID | production-web |
ECS ARN Hierarchy
ECS resources form a clear hierarchy, and the ARN formats reflect this:
- Cluster:
arn:aws:ecs:region:account:cluster/name - Service:
arn:aws:ecs:region:account:service/cluster-name/service-name - Task:
arn:aws:ecs:region:account:task/cluster-name/task-id - Task Definition:
arn:aws:ecs:region:account:task-definition/family:revision - Container Instance:
arn:aws:ecs:region:account:container-instance/cluster-name/instance-id
Long ARN Format
ECS transitioned from a short ARN format to a long ARN format that includes the cluster name in service and task ARNs. The long format (service/cluster/service-name) enables cluster-level scoping in IAM policies. All new resources use the long format by default.
Task Definition ARNs
Task definition ARNs are special because they include a revision number after a colon: task-definition/my-app:7. Without the revision number, the ARN refers to the latest active revision.
Use Case
Configuring ECS service auto-scaling, setting up Application Load Balancer target groups, and writing IAM policies that scope permissions to specific clusters. Also used in CI/CD pipelines for service deployments.