Skip to main content

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 INCOMPLIANT if 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.

Assessment requires all four 14-day averages. If the averages meet the review thresholds and host data cannot confirm either a spare host or sufficient inventory coverage, the result is UNDETERMINED.