-2

i am new to AWS. i have created golden AMI image and want to update my all existing AMI with golden AMI image. please guide me how we can make it possible.

NGoel
  • 1
  • 1
    AMIs are independent of one another and you can't update one from another. You could delete the old AMI and copy the golden AMI to an AMI with the old name if you want to. – jarmod Aug 03 '18 at 15:02
  • What do you mean by "update my all existing AMI with golden AMI image"? Are you talking about instances that were previously launched from the AMI? – John Rotenstein Aug 04 '18 at 03:45
  • Yes @JohnRotenstein. i want the same. – NGoel Aug 04 '18 at 05:04

1 Answers1

0

When an Amazon EC2 instance is launched from an Amazon Machine Image (AMI), the contents of the AMI is copied to the boot volume of the instance. Any changes then made to the disk are stored in Amazon Elastic Block Store (EBS) and is only accessible to that specific instance.

Think of it like cloning a hard disk, then booting a computer from that disk. The operating system, applications, etc will write to the disk.

If you later make a new AMI (it is not possible to modify an AMI), this does not affect existing Amazon EC2 instances. Their disks are unchanged.

So, how can you push updates to the existing instances?

The recommend method is... you don't!

The best way to roll-out changes is to launch new EC2 instances using the new AMI, and then terminate (throw away) the old instances. Any important data should be stored in a database separate to the instances, or in Amazon S3.

The other benefit of this method is that, if something goes wrong with an instance, you can just as easily throw it away and launch a new one. Since all software is already installed and configured on the AMI, the new instances should be able to work just fine.

Yes, there are other methods to updates instances such as using AWS CodeCommit, but that involves changing each existing instance rather than using an AMI.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470