In this recipe, we will create an Amazon Machine Image (AMI) with a web server and then launch an instance from that AMI. Instances from AMIs have faster boot times than instances with the same configuration defined through EC2 user data. In the Using EC2 user data to launch an instance with a web server recipe in Chapter 6, Working with EC2 Instances, we used EC2 user data to update our operating system and set up a simple web server at launch.
Creating an AMI instead of using EC2 user data
Getting ready
Launch an EC2 instance following the Launching an EC2 instance into VPC recipe in Chapter 6, Working with EC2 Instances. SSH into our machine and run the following commands:
sudo su
yum update -y
yum install -y httpd
systemctl...