21

I'm using Elastic Load Balancing to load balance my Auto Scaling Group, for that I have a private AMI that hold my application server (Tomcat) and my web app deployed to it as war ... Now everything works fine ... what if I need to change my tomcat configuration on my AMI. Won't that require launching my AMI --> Login + Change Tomcat configuration --> Create a new AMI --> Delete Old AMI I don't think creating a new AMI is a solution since it'll require updating my Auto Scale Group to add my new AMI

Is there a way where I can update the data in my existing AMI without creating a new one? I just want to have the same AMI ID

3 Answers3

6

You could update your configuration with a user-data script that is run when you launch your instance.

What you put in the script depends on how you manage your configuration at the filesystem level. I personnaly put my configuration files in a Mercurial repository and simply do a pull to update it.

3

It is not possible to update an existing AMI and keep the same AMI id. You will either need to create a new custom AMI and update your launch configuration for the Auto Scaling group, or change your setup to apply changes to the instance after launching an instance of the base AMI as @DavidLevesque suggests.

It is a common architecture to download application, configuration, and data from, say, S3 on launch.

Eric Hammond
  • 11,275
0

This looks like an old post. But in case you're still in the same predicament, you can consider using an Instance Store-Backed Windows AMI (Bundled Task). It's also similar to an AMI but you have more control over the image itself since you practically create the image itself and store it on an S3 bucket. This will allow you to update the underlying image of your AMI every now and then when you need to without having to create a new AMI (at least that's how I understand it).

https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Creating_InstanceStoreBacked_WinAMI.html?icmpid=docs_ec2_console