2

Soon my website and API will be migrated to Amazon's EC2. Correct my if I'm wrong, but my understanding of an Instance AMI works like:

If I launch an EC2 Instance using a for example Amazon Linux AMI then configure the server to my liking (i.e. install a LAMP stack, setup MySQL databases, etc..) then once completed create an AMI of the Instance. Then I can use the saved AMI to launch more instances using the saved AMI I created, and all future instances I create using the saved AMI will retain all settings that were on the EC2 instance I used to create the AMI.

Is my understanding correct? If I create an AMI of an instance that is fully configured to my liking (installed LAMP stack, MySQL, phpMyAdmin, etc...) then create an AMI for it, I can use the AMI to launch new instances that have the exact same files, options, mysql databases, etc... that were present on the instance used to create the AMI?

thehaxdev
  • 67
  • 1
  • 10
  • 1
    You can also use CloudFormation or other automated build tools to achieve something similar. You could have a plain Linux machine, configure the VPC around it, then have the software you need installed (EC2 user data) and download the latest code / files from S3 or elsewhere. This is obviously much slower than starting a server that already has everything installed. You can do both - have an AMI, then using EC2 user data you can update software, download files, etc. – Tim Jan 13 '19 at 08:02

1 Answers1

5

Yes that’s how it works. AMI is a snapshot of your instance at a certain time and all the files on EBS volumes are saved to the AMI.

MLu
  • 24,849
  • 5
  • 59
  • 86