My company is needing to upgrade the OS of our EC2 instances from AML 1 to AML 2 since end of life is 6/2023. We recently released a significantly large add-on to our application, so we are talking about upgrading the instance type as well... Our current instance size is m3.large, and we have seen some latency recently. To clarify, we need OS upgrade AS WELL as instance type upgrade on production environment.

While trying to figure out the best way to go about this, I'm curious if there's anyway to salvage our current server. One of our admins is going to see about upgrading the OS with our current instance so that we don't have to completely rebuild our infrastructure. We use a golden image for our lower environments, and deploy that image from dev server up to production when it comes to lower level downloads/configurations on the server. I have a couple of questions trying to determine the best course of action to upgrading our infrastructure.

What is the dependency to deploying an image among different environments? Is it OS? Is it instance type? What needs to match among all environments to be able to use that image throughout all environments?

If my production instance type is larger than my lower environment instance type, does that have any effect on being able to deploy the image from lower to higher environments?

Is is possible to upgrade the OS on my current instance, and then get a larger production instance type, upgrade the DEV environment OS, use that image and deploy to the upper environments?

Is it even possible to upgrade amazon ec2 instances' OS without having to completely rebuild the server?

Thank you.

  • Interesting question. If you don't get an answer here you might be well advised to try ServerFault. Good luck! Oct 31, 2022 at 19:05

1 Answer 1


I haven't used Amazon Linux much, but with the other distro AMIs I have used, AWS has maintained different images (AMIs) in different regions. There might be configuration in the image that's specific to the local region (and won't work well in other regions), or AWS doesn't want to slow the launch of an EC2 server by reading the image from another region - I don't know.

But the result is that different regions need different AMIs. I have usually built my custom AMIs in each region where I use them, though I have seen a custom AMI copied to a different region and used to launch EC2 servers there. My build steps aren't different for different regions, just the original source AMI is the one for that region, and they're performed on an EC2 server launched in that region.

I've used Hashcorp's Packer to build custom AMIs, though AWS now seems to have a custom AMI builder service, and there has always been the feature to create an AMI from an EC2 server.

In the jobs I've worked, the OS was usually not different between lower non-production environments and higher production environments. The only times my machines used different AMIs were if the lower environments were in a different AWS account or AWS region than the higher, but the AMIs were built from the same source image and configured with the same automatic scripts.

The reason my images weren't different was because the main customization for the server's function (web server, db server, etc.) came from configuration management tools (Puppet, Chef, Ansible, Saltstack, etc.). Some teams prefer to remove the config management layer and customize the images instead. This could make the images for higher environments different from the images for lower environments. There are benefits and drawbacks to both approaches.

On AWS there are a wide variety of instance types/sizes available for HVM images and not as many for PV images. This means you can build an HVM image and use it to launch very small machines, very large ones, and a wide range in between. You don't have to maintain different images for different instance types.

If you add customizations to the image that are specific to the instance type then you could have a problem, but the core Linux images that I've used have no trouble. Unless AWS has a warning about this, I'm sure Linux2 won't have any trouble either.

As for upgrading the Linux1 to Linux2 on your EC2 server, I don't remember if that's possible. The AWS documentation will tell you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .