Saturday, October 8, 2022

[SOLVED] Is it possible to modify an existing AMI to change delete on termination settings on the EBS volumes?

Issue

I have several AMIs that developers use to spin up instances. These AMI do not have "delete on termination" set on all their EBS volumes. At times terminating instances launched using these AMIs has the unintended consequence of leaving behind orphan EBS volumes. Unfortunately, "blessing" a new AMI for general use is quite an ordeal. Is it possible to edit an existing AMI to turn on "delete on termination" or is the only way forward to create a new AMI with the proper settings?


Solution

It is not possible to modify the "Delete on termination" value on an existing AMI.

So you have 2 choices:

  1. Launch an EC2 instance from your AMI and produce a new AMI with the appropriate "Delete on Terminate" value, or
  2. Modify the value when you launch the new EC2 instance.


Answered By - Matt Houser
Answer Checked By - Pedro (WPSolving Volunteer)