π‘οΈ AWS ECS Cluster has spare EC2 capacityπ’
- Contextual name: π‘οΈ Cluster has spare EC2 capacityπ’
- ID:
/ce/ca/aws/ecs/cluster-spare-capacity - Tags:
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
COST,PERFORMANCE
Statsβ
not available
Logicβ
- π§ prod.logic.yamlπ’
Descriptionβ
Descriptionβ
Identify Amazon ECS clusters with evidence of excess EC2 capacity for a fleet consolidation review. Fargate tasks use capacity managed separately from the registered EC2 fleet.
Rationaleβ
Persistent low reservation indicates few registered EC2 resources are allocated to tasks. Combined with an empty, connected host, it identifies a candidate for consolidation. Capacity provider targets, scheduled demand, placement constraints, and Availability Zone failover can justify keeping the headroom.
Auditβ
This policy marks an AWS ECS Cluster as
INCOMPLIANTif all of the following conditions hold.
- Status is ACTIVE, Registered Container Instances Count and Running Tasks Count are positive, and Pending Tasks Count is zero.
- CloudWatch: CPU Utilization, 14-Day and CloudWatch: Memory Utilization, 14-Day are both below 20%.
- CloudWatch: CPU Reservation, 14-Day and CloudWatch: Memory Reservation, 14-Day are both below 40%.
- At least one active container instance has a connected agent and a linked running EC2 instance. Its Running Tasks Count and Pending Tasks Count are both zero, and its Remaining Resources match its Registered Resources, including CPU and memory.
... see more
Remediationβ
Remediationβ
Reduce Spare ECS Cluster Capacityβ
- Review CPU and memory reservation and utilization across a representative workload cycle. Check peak and scheduled demand, deployment headroom, and Availability Zone failover.
- Identify the EC2 capacity provider or Auto Scaling group that owns the spare host. Confirm that the remaining hosts can place the workload, including tasks with port, ENI, GPU, or host-specific requirements.
- Record the current capacity provider and group settings. Review managed draining and scale-in protection. For infrastructure managed through code, apply the change through the existing deployment process.
Using the AWS CLIβ
Inspect the capacity provider's managed scaling settings and backing Auto Scaling group.
aws ecs describe-capacity-providers \
--region {{region}} \
--capacity-providers {{capacity-provider-name}}If the Auto Scaling group minimum is keeping verified spare capacity online, lower it to the minimum required for the workload.
... see more
policy.yamlβ
Linked Framework Sectionsβ
| Section | Sub Sections | Internal Rules | Policies | Flags | Compliance |
|---|---|---|---|---|---|
| πΌ Cloudaware Framework β πΌ Resource Right-Sizing | 26 | no data | |||
| πΌ Cloudaware Framework β πΌ Workload Efficiency | 31 | no data |