π AWS EC2 Instance is idle π’
- Contextual name: π Instance is idle π’
- ID:
/ce/ca/aws/ec2/instance-idle
- Located in: π AWS EC2
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
PERFORMANCE
COST
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
Identify Amazon EC2 instances with minimal activity over the past 14 days and address them to reduce unnecessary costs. Instances are classified as idle if they meet all the following criteria:
- Average CPU utilization below 5%
- Maximum CPU utilization below 15%
- Average network I/O less than 100 MB
Rationalβ
Idle EC2 instances consume resources and incur costs without contributing meaningfully to operations. Adding maximum CPU utilization as a criterion ensures instances experiencing brief spikes in usage are not prematurely identified as idle. This approach improves accuracy in cost-saving measures while maintaining operational efficiency. Addressing idle instances reduces waste and optimizes the AWS environment.
Auditβ
This policy evaluates an EC2 instance based on its 14-day performance metrics.
The instance is marked as
INCOMPLIANT
if all the following criteria are met:
CPU Utilization, Average, %
field is less than 5%.CPU Utilization, Max, %
field is less than 15%.Network In, Sum, Megabytes
field is less than 100 MB.... see more
Remediationβ
Remediationβ
IMPORTANT: Before taking any action, ensure critical data and configurations are backed up. Carefully evaluate idle instances to avoid disrupting essential workloads or losing valuable resources.
From Command Lineβ
Stop Idle Instancesβ
Prerequisitesβ
Verify that the root device of the instance is an EBS volume. You can't stop instances with instance store root device.
Warning: When you stop an instance, the data on any instance store volumes is erased. Before you stop an instance, verify that you've copied any data that you need from the instance store volumes to persistent storage, such as Amazon EBS or Amazon S3.
Stop idle instances to retain their configurations for potential future use:
aws ec2 stop-instances --instance-ids {{instance-id}}
If applicable, initiate hibernation using the
--hibernate
flag for On-Demand or Spot Instances. Hibernation is supported only for EBS-backed instances that are enabled for hibernation and meet the prerequisites. Hibernation saves the contents of the RAM to the Amazon EBS root volume.... see more
policy.yamlβ
Linked Framework Sectionsβ
Section | Sub Sections | Internal Rules | Policies | Flags |
---|---|---|---|---|
πΌ Cloudaware Framework β πΌ Waste Reduction | 10 | |||
πΌ Cloudaware Framework β πΌ Workload Efficiency | 6 |