Hi,
Although it is not possible to associate a new AMI to a running instance, you don't have to worry about the running instance. When you deregister an AMI, it doesn't affect any instances that you've already launched from the AMI. The only thing is it can't be used to launch any new more instances.
Deregister your AMI - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/deregister-ami.html
If the deleted AMI has custom configurations, I would also recommend you create a new AMI form the already running instance so that you can launch new instances with those custom configurations in future.
Thank you for the response. "If the deleted AMI has custom configurations, I would also recommend you create a new AMI form the already running instance so that you can launch new instances with those custom configurations in future." This means the running EC2 instance(EC2-A) may not have an associated AMI (AMI-A) but we can create a custom AMI (AMI-B) from that running instance and that custom AMI(B) can be used to create a new EC2 (EC2-B) when the need arises/EC2-A got destroyed. That's good to know. Am I correct?
Relevant questions
Error on Dashboard "An error occurred" and unable to create instance due to "Error loading AMI data".
asked 2 months agoPassword is not available for custom AMI
asked a year agoAdvise on Creating a Custom AMI from an Existing Beanstalk-Managed EC2 Instance
asked 7 months agoUpdating AMI of a EC2 Fleet
asked 3 years agoCloudFormation template publishing without creating and publish an AMI
asked 3 years agoAMI Deletion and Add new AMI to existing EC2
asked 10 days agoNot able to login to EC2 running Oracle Linux(Custom AMI)
asked 3 years agoUnable to SSH to new instances unless its an AWS Ami
Accepted Answerasked 3 years agoUnable to create instance from newly created AMI
asked 3 years agoWindows Custom AMI
asked 5 months ago
Yes, you are correct. You can find the instructions for creating an AMI from an existing instance in the EC2 User Guide at this link: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html