Use Case for AWS EBS Volume Unattached
Quick Links
- Configure AWS EBS Volume Unattached
- Use Case for AWS EBS Volume Unattached
- Triage Guides by Violation Type
AWS EBS Volume Unattached Policy
Why Use This Policy?
Unattached EBS volumes are a common source of unnecessary costs within AWS environments. These volumes are not currently in use; they are not attached to any EC2 instance, yet they continue to incur storage charges. Identifying and decommissioning these unattached EBS volumes can result in significant cost savings.
Pros
- Cost Savings: Eliminates costs associated with unused EBS volumes.
- Resource Optimization: Helps maintain a clean and efficient cloud environment by removing unnecessary resources.
Cons
- Manual Verification: Some volumes might be intentionally unattached for future use or as backups. Therefore, you need to manually verify their purpose before deletion.
How This Policy Works
This policy checks the attachment status of a specified AWS EBS volume. If the volume is found unattached, it flags it for further action.
Policy Variables
- None
Violation Types and Definitions
EBS_VOLUME_UNATTACHED
: This violation indicates that the EBS volume has no active attachments. Immediate action is recommended to review and remove the volume if it is not needed.
Policy Implementation
The policy function uses the AWS SDK to call the DescribeVolumes
method of the EC2Client, retrieving the attachment status of a given volume. If the volume is unattached, the policy expression evaluates this and generates a violation.