Lab 2: Build Your VPC and Launch A Web Server: Accessing The AWS Management Console
Lab 2: Build Your VPC and Launch A Web Server: Accessing The AWS Management Console
Web Server
2. Wait until you see the message "Lab status: ready", then choose the X to close the
Start Lab panel.
3. At the top of these instructions, choose AWS
This will open the AWS Management Console in a new browser tab. The system will
automatically log you in.
Tip: If a new browser tab does not open, there will typically be a banner or icon at the
top of your browser indicating that your browser is preventing the site from opening pop-
up windows. Choose on the banner or icon and choose "Allow pop ups."
4. Arrange the AWS Management Console tab so that it displays along side these
instructions. Ideally, you will be able to see both browser tabs at the same time, to make
it easier to follow the lab steps.
The wizard has provisioned a VPC with a public subnet and a private subnet in the
same Availability Zone, together with route tables for each subnet:
The Public Subnet has a CIDR of 10.0.0.0/24, which means that it contains all IP
addresses starting with 10.0.0.x.
The Private Subnet has a CIDR of 10.0.1.0/24, which means that it contains all IP
addresses starting with 10.0.1.x.
You will now configure the Private Subnets to route internet-bound traffic to the NAT
Gateway so that resources in the Private Subnet are able to connect to the Internet,
while still keeping the resources private. This is done by configuring a Route Table.
A route table contains a set of rules, called routes, that are used to determine where
network traffic is directed. Each subnet in a VPC must be associated with a route table;
the route table controls routing for the subnet.
Note that Destination 0.0.0.0/0 is set to Target nat-xxxxxxxx. This means that traffic
destined for the internet (0.0.0.0/0) will be sent to the NAT Gateway. The NAT Gateway
will then forward the traffic to the internet.
This route table is therefore being used to route traffic from Private Subnets. You will
now add a name to the Route Table to make this easier to recognize in future.
You will now associate this route table to the Private Subnets.
You can expand the Subnet ID column to view the Subnet names.
You will now configure the Route Table that is used by the Public Subnets.
24. Select the route table with Main = No and VPC = Lab VPC (and deselect any other
subnets).
25. In the Name column for this route table, choose the pencil then type Public Route Table ,
and choose Save
26. In the lower pane, choose the Routes tab.
Note that Destination 0.0.0.0/0 is set to Target igw-xxxxxxxx, which is the Internet
Gateway. This means that internet-bound traffic will be sent straight to the internet via
the Internet Gateway.
You will now associate this route table to the Public Subnets.
Your VPC now has public and private subnets configured in two Availability Zones:
You will use this security group in the next task when launching an Amazon EC2
instance.
First, you will select an Amazon Machine Image (AMI), which contains the desired
Operating System.
41. In the row for Amazon Linux 2 (at the top), choose Select
The Instance Type defines the hardware resources assigned to the instance.
You will now configure the instance to launch in a Public Subnet of the new VPC.
#!/bin/bash
# Install Apache Web Server and PHP
yum install -y httpd mysql php
# Download Lab files
wget https://aws-tc-largeobjects.s3.us-west-2.amazonaws.com/CUR-TF-100-ACCLFO-2/2-lab2-vpc/s3/lab-app.zip
unzip lab-app.zip -d /var/www/html/
# Turn on web server
chkconfig httpd on
service httpd start
This script will be run automatically when the instance launches for the first time. The
script loads and configures a PHP web application.
Tags can be used to identify resources. You will use a tag to assign a Name to the
instance.
You will configure the instance to use the Web Security Group that you created earlier.
This is the security group you created in the previous task. It will permit HTTP access to
the instance.
This may take a few minutes. Choose refresh in the top-right every 30 seconds for
updates.
You will now connect to the web server running on the EC2 instance.
59. Select Web Server 1.
60. Copy the Public DNS (IPv4) value shown in the Description tab at the bottom of the
page.
61. Open a new web browser tab, paste the Public DNS value and press Enter.
You should see a web page displaying the AWS logo and instance meta-data values.