Disable an Amazon EC2 AMI
About
You can deactivate an AMI
to stop it from being utilized for instance launches. Launching new instances
from a deactivated AMI is not possible. A disabled AMI can be reactivated,
allowing it to be used again for instance launches. Both public and private
AMIs can be deactivated.
To lower storage expenses
for infrequently used disabled EBS-backed AMIs that must be kept long-term, you
can archive their related snapshots.
How AMI disable works?
When an AMI is disabled:
- The AMI's state changes to disabled.
- A disabled AMI can't be shared. If an AMI was public or previously shared, it is made private. If an AMI was shared with an AWS account, organization, or Organizational Unit, they lose access to the disabled AMI.
- A disabled AMI does not appear in DescribeImages API calls by default.
- A disabled AMI does not appear under the Owned by me console filter. To find disabled AMIs, use the Disabled images console filter.
- A disabled AMI is not available to select for instance launches in the EC2 console. For example, a disabled AMI does not appear in the AMI catalog in the launch instance wizard or when creating a launch template.
- Launch services, such as launch templates and Auto Scaling groups, can continue to reference disabled AMIs. Subsequent instance launches from a disabled AMI will fail, so it is recommended to update launch templates and Auto Scaling groups to reference available AMIs only.
- EC2 instances that were previously launched using an AMI that is subsequently disabled are not affected, and can be stopped, started, and rebooted.
- You can't delete snapshots associated with disabled AMIs. Attempting to delete an associated snapshot results in the snapshot is currently in use error.
When an AMI is
re-enabled:
- The AMI's state changes to available, and it can be used to launch instances.
- The AMI can be shared.
- AWS accounts, organizations, and Organizational Units that lost access to the AMI when it was disabled do not regain access automatically, but the AMI can be shared with them again.
Costs
When you disable an AMI,
it does not get deleted. If the AMI is backed by EBS, you'll still incur
charges for the AMI's EBS snapshots. If you wish to retain the AMI, you may be
able to lower your storage expenses by archiving the snapshots. For additional
details, refer to the section on Archiving Amazon EBS snapshots in the Amazon
EBS User Guide. If you decide against keeping the AMI and its snapshots, you
need to deregister the AMI and remove the snapshots.
Prerequisites
To disable or re-enable
an AMI, you must be the owner of the AMI.
Conclusion
The method of how a disabled Amazon EC2 AMI works is discussed.
Hi brother
ReplyDeleteContact me
ReplyDelete