Skip to content

Why is “Delete on Termination” checked by default for EBS volumes?

0

When configuring EBS volumes for an EC2 instance, the “Delete on Termination” option is checked by default. From my understanding, one of the biggest advantages of EBS is data persistence beyond the instance lifecycle, allowing quick recovery and reattachment to new instances. Making deletion the default seems counterintuitive and could lead to accidental data loss if users overlook this setting. Wouldn’t it make more sense to have this option unchecked by default, so volumes aren’t tied to the instance state unless explicitly chosen? Could someone explain the rationale behind this default behavior?

1 Answer
1
Accepted Answer

The "Delete on Termination" behavior for EBS volumes actually varies depending on the volume type:

For root EBS volumes (the boot volume of your EC2 instance), "Delete on Termination" is set to true by default. This means that when you terminate an EC2 instance, its root volume will be automatically deleted.

For additional EBS data volumes that are attached during instance launch, "Delete on Termination" is set to false by default. These volumes will persist even after the instance is terminated.

The rationale behind deleting root volumes by default likely relates to cost management and resource cleanup. Since root volumes typically contain the operating system and application files rather than unique data, AWS assumes most users don't need to retain these volumes after instance termination. This default behavior helps prevent accumulating unused volumes that continue to incur charges.

If you want to preserve your root volume data after termination, you can explicitly change this setting by setting the DeleteOnTermination attribute to false either during instance launch or later on. This gives you the flexibility to keep important data while preventing unnecessary storage costs for volumes you don't need.

For your data volumes, AWS does recognize the importance of data persistence by making preservation the default behavior, aligning with the data persistence advantage of EBS that you mentioned.
Sources
understand the behavior of root Amazon EBS | AWS re:Post
Keep an Amazon EBS root volume after an Amazon EC2 instance terminates - Amazon Elastic Compute Cloud
Features and benefits of Amazon EBS volumes - Amazon EBS
How instance termination works - Amazon Elastic Compute Cloud
Delete unattached Amazon EBS volumes - AWS Prescriptive Guidance

answered a year ago

AWS
EXPERT

reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.