# Delete-on-Termination Disabled for EBS Volume

Canonical: https://www.pointfive.co/efficiency-hub/inefficiencies/delete-on-termination-disabled-for-ebs-volume

[Cloud Efficiency Hub](https://www.pointfive.co/efficiency-hub) 

# Delete-on-Termination Disabled for EBS Volume

## Explanation

When EC2 instances are provisioned, each attached EBS volume has a \`DeleteOnTermination\` flag that determines whether it will be deleted when the instance is terminated. If this flag is set to \`false\` - often unintentionally in custom launch templates, AMIs, or older automation scripts - volumes persist after termination, resulting in orphaned storage. While detached volumes are easy to detect and clean up after the fact, proactively identifying attached volumes with \`DeleteOnTermination=false\` can prevent future waste before it occurs.

## Relevant Billing Model

EBS volumes are billed per GB-month of provisioned storage. If a volume is not automatically deleted when its EC2 instance is terminated, charges continue to accrue even if the volume is no longer in use.

## Detection

- The volume is attached to an active EC2 instance

- The \`DeleteOnTermination\` flag is set to \`false\`

- The instance is not intended to retain persistent data on termination (e.g., ephemeral workloads or stateless apps)

## Remediation

- Update the instance configuration to set \`DeleteOnTermination=true\` for non-persistent volumes

- Modify infrastructure-as-code templates and launch configurations to use the correct flag by default

- Establish policy controls or monitoring to flag instances with unnecessary persistent volume retention

- Periodically review long-lived instances for non-root volumes with this misconfiguration

- Educate engineering teams on the default behavior and risks of leaving the flag unset

## Relevant Documentation

[Amazon EBS Volume Lifecycle](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes.html) 
[ModifyInstanceAttribute - AWS CLI](https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-instance-attribute.html)

[Submit Feedback](https://hub.pointfive.co/inefficiencies/delete-on-termination-disabled-for-ebs-volume)

## At a glance

Reference

CER-0154

Cloud provider

AWS

Service

AWS EBS

Category

[Storage](https://www.pointfive.co/efficiency-hub/service-category/storage)

Inefficiency type

Misconfiguration Leading to Future Orphaned Resource

## Contributed by

- Dvir Mizrahi 

### Dvir Mizrahi

VP of FinOps @ Wiv.ai

[LinkedIn](https://www.linkedin.com/in/dvir-mizrahi/)

---
Source: the public page above. Product screenshots and illustrative interfaces are examples, not live customer data.

