Create an EC2 Instance and Install a Web Server
In this step you create a web server to connect to the Amazon RDS DB instance that you created.
Launch an EC2 Instance
First you create an Amazon EC2 instance in the public subnet of your VPC.
To launch an EC2 instance
- Sign in to the AWS Management Console and open the Amazon EC2 console athttps://console.aws.amazon.com/ec2/.
- Choose EC2 Dashboard, and then choose Launch Instance, as shown following.
- Choose the Amazon Linux Amazon Machine Image (AMI), as shown following.
- Choose the t2.micro instance type, as shown following, and then choose Next: Configure Instance Details.
- On the Configure Instance Details page, shown following, set these values and leave the other values as their defaults:
– Network: Choose an existing VPC, for example: vpc-f1b76594 (10.0.0.0/16) | tutorial-vpc
– Subnet: Choose an existing public subnet, for example: subnet-fe2adba7(10.0.0.0/24)| Tutorial-public | us-west-2a
– Auto-assign Public IP: Enable
- Choose Next: Add Storage.
- On the Add Storage page, leave the default values and choose Next: Tag Instance.
- On the Tag Instance page, shown following, set Value for the Name tag to tutorial-web-server, and then choose Next: Configure Security Group.
- On the Configure Security Group page, shown following, choose Select an existing security group, and then choose an existing security group, for example: tutorial-securitygroup. The security group must include inbound rules for SSH and HTTP access.
- Choose Review and Launch.
- On the Review Instance Launch page, shown following, verify your settings and then choose Launch.
- On the Select an existing key pair or create a new key pair page, shown following, choose Create a new key pair and set Key pair name to tutorial-key-pair. Choose Download Key Pair, and then save the key pair file on your local machine. You use this key pair file to connect to your EC2 instance.
- To launch your EC2 instance, choose Launch Instances. On the Launch Status page, shown following, note the identifier for your new EC2 instance, for example: i-7abfcfb8.
- To find your instance, choose View Instances.
- Wait until Instance Status for your instance reads as running before continuing.