Professional Documents
Culture Documents
Amazon Virtual
Private Cloud (VPC)
1 hour 25 minutes8 Credits
Rate Lab
Lab overview
In this lab, you will create a basic virtual private cloud (VPC) without using the
VPC Wizard. The VPC that you build will include a web server and an Amazon
RDS database. Once you have created both, you will connect your address
book application running on your web server to your Amazon RDS for MySQL
instance. Once you have successfully configured your address book
application with your RDS instance, you will be able to add and remove
contacts from the address book.
Topics covered
Start Lab
1. At the top of your screen, launch your lab by clicking Start Lab
This will start the process of provisioning your lab resources. An estimated
amount of time to provision your lab resources will be displayed. You must
wait for your resources to be provisioned before continuing.
If you are prompted for a token, use the one distributed to you (or credits you
have purchased).
2. Open your lab by clicking Open Console
This will automatically log you into the AWS Management Console.
If you see the message, You must first log out before logging into a
different AWS account:
Click click here
Close your browser tab to return to your initial Qwiklabs window
Click Open Console again
Task 1: Create a VPC
In this task, you will create a base VPC.
A security group acts as a virtual firewall for your instance to control inbound
and outbound traffic. When you launch an instance in a VPC, you can assign
up to five security groups to the instance. Security groups act at the instance
level, not the subnet level. Therefore, each instance in a subnet in your VPC
could be assigned to a different set of security groups. If you do not specify a
particular group at launch time, the instance is automatically assigned to the
default security group for the VPC.
31. In the left navigation pane, click Security Groups.
32. Click Create security group then configure:
Security group name:
Description:
VPC: My VPC
Click Create
Click Close
33. Select Web server.
34. Click the Inbound Rules tab.
35. Click Edit rules then configure:
Click Add Rule
Type: HTTP
Source: Anywhere
Click Save rules
Click Close
In the next task you will launch your web server into one of your public
subnets.
Congratulations! You should be able to see this page. Currently, you do not
have a database. Once you create your RDS instance, you will be able to
connect it to your web server.
Task 7: Create Private Subnets for your
MySQL Server
To deploy your RDS database, your VPC must have at least one subnet in at
least two Availability Zones in the region where you want to deploy your DB
instance. In this task, you will create two private subnets for your Amazon
RDS instance.
Before you can connect your address book application to your database, you
need to know the endpoint of the RDS instance. This is the address of your
RDS instance.
86. Click your mydb instance.
87. Under the Connectivity section, copy the Endpoint to your
clipboard.
You RDS endpoint should look similar to:
mydb.ciljcs3yv1rb.us-west-2.rds.amazonaws.com
88. Return to the browser tab that is displaying your web server, then
configure:
Endpoint: Paste your MySQL endpoint
Database:
Username:
Password:
Click Submit
Once connected, you should see an address book with two entries.
Conclusion
Congratulations! You have now successfully:
Created an Amazon Virtual Private Cloud (VPC)
Created a public and private subnets
Created an Internet gateway
Created a Route Table and added a route to the Internet
Created a security group for your web server to only allow HTTP traffic
to your web server
Created a security group for your MySQL RDS instance to only allow
MySQL traffic from your public subnets
Deployed a web server and a MySQL RDS instance
Configured your application to connect to your MySQL RDS instance
End Lab
Follow these steps to close the console, end your lab, and evaluate the
experience.
Additional Resources
VPC Introduction
Route Tables
Security Groups for Your VPC
Internet Gateways
AWS Training and Certification
For feedback, suggestions, or corrections, please email us at: aws-course-
feedback+spl@amazon.com