6.6 Create a Custom VPC Part 5

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
or

Already have an account? Sign In »

Time
3 hours 27 minutes
Difficulty
Beginner
CEU/CPE
4
Video Transcription
00:00
hello
00:01
and welcome to the final video of our VPC labs.
00:06
In our last video, we were able to create a gnat gateway
00:10
and perform a yum update
00:12
of our private server
00:15
in this video.
00:17
Well, actually create a relational database instance and launch it from within our private sudden it.
00:24
We will also create a script
00:26
to build and launch our public facing PHP Sever.
00:31
It's going to be a fun lesson, so let's get started.
00:36
Since this is an introductory AWS course, I haven't included the topic of databases
00:42
provided within the AWS platform.
00:46
Amazon has a great selection of sequel and no sequel database offerings
00:51
that you can and will use as you go further in your cloud career.
00:58
Database theory is beyond the scope of our course,
01:00
but I will give you the 20,000 foot view
01:03
of the my sequel Relational Database
01:07
that we will create in this lesson.
01:11
Amazon Relational Database service
01:15
is a Web service
01:15
that makes it easier
01:18
for us to build, operate and scale a relational database In the AWS clout,
01:23
Amazon RD s manages the backups,
01:27
handles software, patching
01:30
automatic failure, detection
01:33
and recovery.
01:34
Essentially, A W s handles all of the data base maintenance for us
01:38
permitting us to focus on its administration
01:44
for more information about a W S R. D s.
01:47
Here is the link to the
01:49
frequently asked questions page.
01:53
So
01:53
let's get into the AWS console
01:57
and type R D s in the search bar.
02:04
This takes us to the Amazon RGs dashboard
02:07
scroll down to create database,
02:16
select my sequel,
02:20
then scroll down until we reach the setting section.
02:29
I'm going to name the instance Cyber Very my sequel, D B.
02:35
Since this is just a demo,
02:38
I will use this also as mine database, user name and password.
02:44
So just copy and paste that in,
02:46
then click next
02:49
under advanced settings,
02:52
we will launch this
02:53
in our custom VPC
02:57
the subject group remains the same.
03:00
By default, our database will not be public
03:04
for availability zone.
03:07
I will select our private sudden it
03:09
We will be creating a new V p C security group
03:15
for database name
03:16
paste in the same value that we use previously.
03:21
Leave everything else is default.
03:23
Then we just scroll down.
03:35
I will disable delish in protection because we will want to delete this data base at the end of the demonstration,
03:43
then select, Create database.
03:46
Now are instances being created
03:49
Quick view database instance details.
03:53
And here we can see some of the metrics
03:55
that are instances already collecting.
04:05
Now we will need to create a new security group. So let's scroll down to the security groups section
04:15
quick the length.
04:24
Next, click the inbound tab under our security group,
04:29
then edit.
04:31
We were at a role to our security group that will permit our public sub net
04:35
to talk to our private instance on TCP 3306
04:41
which is the port that our database uses.
04:45
Then type SG
04:46
toe auto populate our security group.
04:49
Been safe.
04:51
Remember, we have to perform this step
04:55
or else our RD s instance will not be able to communicate with our front end PHP server
05:00
in the public sub net.
05:03
So now let's launch our public facing server.
05:08
Remember,
05:09
we will use a script to create our PHP, sir.
05:14
So
05:15
select the usual tea to micro instance,
05:21
we will launch within our public vpc
05:27
in our public sub net
05:30
leave. The rest is default.
05:31
Then scroll down
05:36
quick advanced details.
05:42
Here's the script that we will be adding
05:45
the first line begins with shebang and then points to the path of our bash interpreter.
05:51
The next line installs our PHP Apache server.
05:58
In the next line,
06:00
we perform a U M update of the OS
06:04
Next line we checked to see if our
06:08
server process is running.
06:13
Next time we start the service
06:16
Once started,
06:17
we will print out the PHP info toe our landing page called index dot PHP.
06:25
Then we change directories to the Apache server directory.
06:30
Next
06:32
we issue a w get to retrieve a file
06:35
that I have already uploaded to an S three bucket
06:39
that will contain the connection information for our database. Instance
06:44
that PHP file looks like this.
06:47
It's a small P H P script
06:49
that creates connection to our database.
06:54
It supplies the AWS in point
06:57
the database user name
06:59
and password
07:00
invariable called con.
07:03
If it fails to connect, then it will give us an error.
07:08
If the connection is successful, then it will print
07:12
that it successfully connected.
07:15
So
07:15
that's paste in our bootstraps script.
07:19
Great.
07:27
Next as starts,
07:34
then let's add attack
07:42
for name. I would just re use our old public Web server name
07:50
next
07:53
select an existing security group.
08:00
Then click Launch.
08:03
Let's select our existing key pair.
08:11
Next, I will filter on just our new instance.
08:16
So let's give that some time to boot up.
08:24
Great. Now it's running.
08:26
Let's copy the I P address to the clipboard
08:31
and test it out on our browser.
08:37
Cool. So our Pitch P bootstrap script worked.
08:48
Now let's log into our PHP server. Instance.
08:54
We will copy our private key to the dashboard,
09:05
then connect to our PHP server using the SS H agent forwarding
09:15
Awesome we were able to authenticate.
09:18
Now let's make ourselves route
09:22
and then change directories to our Apache server directory.
09:28
That's if I can type in the correct directory.
09:37
So when we perform a list on the directory, we see two files.
09:41
If you recall in our script,
09:43
we copied the
09:46
D B Connect that PHP file
09:48
from Rs three Bucket toe are patchy server directory.
09:52
So
09:54
our script appears to have worked correctly.
09:58
Let's edit the D B connect dot PHP file
10:03
type nano space, D B connect dot PHP.
10:13
We will need to edit the variable d be host
10:16
2.2 R. A W. S R. D s in point.
10:26
Okay,
10:28
let's go back out to the council
10:31
toe R. R. D s instance
10:33
and copy our database in point.
10:37
Quick database instances
10:43
select our instance.
10:46
Then copy our in point.
10:52
Now let's paste that into our PHP file,
11:01
then control X
11:03
shift. Why to save.
11:07
Now let's go back to our browser
11:11
Then
11:13
when our PHP info landing page
11:16
type forward slash
11:18
d b connect dot PHP to connect to our database server
11:28
and
11:28
our connection was successful.
11:33
If you have remained with us this long,
11:37
awesome job, everyone.
11:39
You've actually learned quite a bit
11:41
and you are well on your way to becoming
11:43
and AWS solution architect.
11:46
In these videos,
11:50
we have created a custom VPC
11:54
step by step,
11:56
and we have tested our V p C for reach ability.
Up Next
Intro to AWS

This Introduction to Amazon Web Services (AWS) course will teach you about Amazon's secure cloud services platform, offering compute power, database storage, content delivery and other functionality to help businesses scale and grow.

Instructed By