Deregister an Amazon EC2 AMI

 







About

When you deregister an AMI, it is permanently removed from Amazon EC2. Once an AMI is deregistered, it can no longer be used to launch new instances. You might want to deregister an AMI after you have finished using it.

To safeguard against accidental or intentional deregistration of an AMI, you can enable protection. If you mistakenly deregister an EBS-backed AMI, you have the option to use the deregistration Recycle Bin to restore it, provided you do so within the specified time frame before it is permanently deleted.

When you deregister an AMI, you have the option to delete its associated snapshots simultaneously. However, if a snapshot is linked to several AMIs, it will not be removed even if you choose to delete it; the AMI will still be deregistered. Any snapshots that are not deleted will still result in ongoing storage charges.

Deregistering an AMI does not impact any instances that were started from it. You can still operate these instances without any issues. By default, deregistering an AMI does not affect any snapshots created when the AMI was made. You will still accrue usage charges for these instances and storage fees for the snapshots. Thus, to prevent unnecessary expenses, we advise that you terminate any instances and remove any snapshots that are not needed. You can either delete the snapshots automatically when deregistering or do so manually afterward.

Considerations

You can't deregister an AMI that is not owned by your account.

You can't use Amazon EC2 to deregister an AMI that is managed by the AWS Backup service. Instead, use AWS Backup to delete the corresponding recovery points in the backup vault.

Deregister an AMI

You have the option to deregister both EBS-backed AMIs and instance store-backed AMIs. When deregistering EBS-backed AMIs, you may also choose to delete the corresponding snapshots concurrently. Nonetheless, if a snapshot is linked to other AMIs, it will remain intact even if you indicate that you want it deleted.

Avoid Costs From Unused Resources

Deregistering an AMI does not automatically remove all resources linked to the AMI. These resources consist of snapshots for EBS-backed AMIs and the files in Amazon S3 for instance store-backed AMIs. Additionally, when an AMI is deregistered, it does not stop or terminate any instances that were created from the AMI.

You will still be charged for the storage of snapshots and files, as well as for any active instances. To prevent incurring these unnecessary expenses, it is advisable to delete any resources that are no longer needed.

Protect an Amazon EC2 AMI From Deregistration

You can enable deregistration protection on an AMI to safeguard against accidental or malicious deletion. Once you enable this protection, the AMI cannot be deregistered by any user, irrespective of their IAM permissions. To deregister the AMI, you must first disable the deregistration protection.

When you enable deregistration protection on an AMI, you have the option to set a 24-hour cooldown period. This cooldown period refers to the duration during which deregistration protection stays active after you disable it. Throughout this cooldown timeframe, the AMI is not allowed to be deregistered. After the cooldown period concludes, the AMI can be deregistered. By default, deregistration protection is off for all current and newly created AMIs.

Turn off Deregistration Protection

If you opted to set a 24-hour cooldown period when enabling deregistration protection for the AMI, then upon disabling deregistration protection, you won’t be able to deregister the AMI right away. The cooldown period is the 24-hour interval during which deregistration protection is still active even after you switch it off. During this cooldown interval, the AMI cannot be deregistered. Once the cooldown period concludes, the AMI becomes eligible for deregistration.

Conclusion

Some features of deregistering a Amazon EC2 AMI are discussed above. 







 

 





























Comments

Popular posts from this blog

Deployment (Part 3)

Deployment (Part 1)

Deployment (Part 2)