1

I wanted to ask more experienced cloud users, I am thinking about deploying my applications in EC2 machines using AMI snapshots. Each new release is new AMI snapshot containing application artifacts, built from base image, each EC2 is replaced on deploy.

Is it a bad practice? Are there any possible problems or vulnerabilities that could occur when using this approach? I don't see any drawbacks apart from long deployment time.

3
  • Using golden images is pretty standard, the only thing to consider is how you create the ami and if you have anything running on the box that could potentially break, for example the jumpcloud linux agent would break and would require a new installation each time you stood it up etc... Commented Mar 21, 2022 at 18:59
  • Building new AMI for deployment is a good practice with respect to security. However, it is slower (as you've already mentioned). You can consider using tools such as Hashicorp Packer for this type of work. Commented Mar 21, 2022 at 21:36
  • If you are looking for 'opinions', you might get a better response at: reddit.com/r/aws Commented Mar 21, 2022 at 23:00

1 Answer 1

1

It's not a bad practice. A lot of vendors these days are creating their AMIs and sharing it with their clients. Creating an AMI is not the hard part, you can always start an instance from previous AMI, update it, and call AWS API to create a new AMI from the instance once you finalized it.

You will however want to automate the tasks involved as it would be cumbersome to manually do update your code, update the image and install security updates while at it and do any cleanup you may need.

Deployment is a different story. Problem there is ami-id will now change and you need a way to update the ami-id for whichever product is launching the instances. You could tag your AMIs and build logic to always use the tag and look for the latest one when choosing the ami-id etc.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.