Amazon EC2 – Update Existing AMI

amazon ec2amazon-amiamazon-web-servicesautoscalingload balancing

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

Best Answer

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.