Creating our first web server
Now that we have our environment set up, we are finally ready to launch our first EC2 instance. There are a couple of ways to do that. Since we just installed and configured awscli and we want to see effective ways of managing infrastructures, we will demonstrate how to do this using the command-line interface.
Launching a virtual server requires having a certain amount of information ahead of time. We will use the aws ec2 run-instances
command, but we need to supply it with:
- An AMI ID
- An instance type
- A security group
- An SSH key-pair
AMI
An Amazon Machine Image (AMI) is a package that contains, among other things, the root filesystem with the operating system (for example, Linux, Unix, or Windows) and additional software required to start up the system. To find the proper AMI, we will use the aws ec2 describe-images
. By default, the describe-image command will list all the public AMI available which is way over 3 million by now. To get the best out of that command...