Okay.
Hello loggers and welcome to this lecture in this lecture.
We're going to provision our very first easy to instant.
So this is part one we're going to keep it just under 20 minutes if we can.
And we're going to provision a little easy to instance and turn it into a web server.
So this is a lab and you will need to log into the AWOL console.
Okay.
So here I am in the obvious console now.
Up here we can control our region.
I'm gonna do this.
Rest of this course in Northern Virginia.
And we're going to go over to services and we'll we'll find easy to as the very first service that's
under compute.
Go ahead and click on that.
So this is the easy to dashboard.
This is actually a new dashboard you can toggle between the old dashboard and the new dashboard just
by turning this off on and off.
I'm gonna use the new dashboard and you can see here that I've got everything as zeros so I haven't
gone in and launched an easy to instance before.
So we can launch an easy to instance just by clicking in here and going to launch instance and go ahead
and launch your first instance.
Now step one is always to choose an Amazon machine image and an Amazon machine.
Image is just choosing your virtual machine.
So do you want to be running Amazon Linux or do you want to be running SUSE Linux or Red Hat or would
you like to be running Windows for example.
So I'm going to go with Amazon Linux to EMI.
We are going to use this for the rest of the course.
So go ahead and click on Amazon Lennox to EMI in here we've got all our different instance types so
we can actually control it up here as well as we could have micro instances compute optimized general
purpose GP you memory optimized storage optimized etc. and see if you can remember that new monarch
it was fate.
Dr. Mac Pixie a use so that's these instances in here now where you will see free tier eligible.
That means that this instance stays within free tier.
So for the rest of this course we are going to be using t t to micros T3.
You can get T3 micros now but again it's not going to be free to eligible some around a t to micro just
go ahead and configure our instance details and this is where we really start to set everything up.
So the number of instances I'm going to launch one I'm not going to click launch into an order scaling
group.
We're going to cover off auto scaling group in the high availability section of the course down here.
We couldn't do request spot instances so we could set our spot price.
I'm not going to do that we're just going to go on demand.
We're going to launch it into our default VPC VPC just stands for virtual private cloud.
We're gonna have a whole VPC section coming up.
Right now we're just using our own default BPC as the Amazon create for us.
And when we go into the BBC section of course we'll be creating our own subnets in here.
This is a way of choosing which availability zone you want to go into.
So if you want USD one A one B 1 C etc etc. You can select in here.
Interesting thing to note is that this is randomize so if I was to sign up to another AWB account and
I select us e one a basically the two accounts might be in completely different Availability Zones.
So one A for one account is might not be one a for another account.
So something to note down here we've got auto assigned public IP address.
I'm gonna do that placement groups we haven't covered off.
We will cover that off later but essentially it's for high performance computing capacity reservations
so this is where you can reserve capacity on your easy two instances in a specific availability zone
not going to do that.
I am rolls will cover off later and here we've got our shutdown behaviour.
So what happens if we shut down this instance.
Do we want to stop it or terminate it.
Here we've got enable termination protection.
This is to stop us from accidentally deleting our AC two instances.
I am going to enable it for this one.
Here we've got monitoring.
So this has enabled cloud watch.
We are going to cover off cloud watch in this section of the course cloud watch by default will monitor
your AC two instances every five minutes if you want it to be less than that if you want it to be every
1 minute interval you need to enable detailed monitoring but if you do do that you won't be within free
tier tenancy in here we can say hey I want shared hardware I want a dedicated instance or a dedicated
hosts I'm just going to use shared hardware elastic interface we won't cover off yet and down here we've
got advanced details and this is where we can pass bootstrap scripts so we're going to look at that
later on in this section of the course.
So basically all you need to do is go ahead and click on the protect against termination accidental
termination and you can go ahead and leave everything else as default.
Next let's go in and add our storage.
Now we are going to cover off the different IBS volume types later on in this section of the course
but for now we've got three we've got general purpose we've got provisioned ops these are both SSD and
then we have magnetic which is standard and if we click over hearing add new volume we actually get
more options and that's because this is the route device volume and the route device volume can only
launch on SSD or magnetic standard but you can have additional volumes and additional volumes include
things like cold hard disk drive and throughput optimize Hard Disk Drive and these are all magnetic
as well.
Like I said let's not get too bogged down in this right now.
We're going to go and learn about that later on in this section of the course.
I'm going to delete this off.
So we're just going to launch the route device volume when we say route device volume or IBS or we're
talking about as a virtual disk on in the cloud.
This is where our operating system is going to be installed.
So let's go ahead and add our tags.
I am going to add some tags here so I'm going to call this name.
I'm gonna call it Web Server 0 1 the department.
So this is the apartment that owns that web server.
I'm just going to call it Developers developers and add another tag so we might have employee I.D. and
this would be our employee I.D. who provision it et cetera et cetera.
So this is a way of keeping track of our easy to and our NWS infrastructure.
Let's go ahead and configure our security group.
Now security group is just a virtual firewall.
That's all it is it's a virtual firewall which allows communication over particular ports.
I'm going to cover security groups in a lot of detail in the VPC section of the course.
But for now I just understand that it's a virtual firewall.
This is how you enable traffic on the various different ports.
So each DDP goes across port 80 SS each goes up cross port 22 so you're just allowing various different
types of communication to easy to instance through your security group.
We are going to create a new security group.
I'm just going to call mine web DMZ so demilitarised zone.
So this is the security group that all my web servers are going to go into and I'm going to add a rule.
I'm going to allow port 80 so each DP and we're going to do it to the 0 0 dot dot dot forward slash
0.
And so this is a side address range again we're going to cover this off in the networking section of
the course.
But essentially when these are all zeros you're opening it up to the whole world.
Now you might want to lock your SS H down to your particular IP.
You can just click in there and then it will lock it down to this IP address so you can only SS H in
on this IP address the problem and that is that if your IP address changes then you won't be able to
access this easy to instance.
So I'm just going to do Oh Dot Dot Dot forward slash some copy and paste it in there and I'll give us
a little warning.
So let's go ahead and hit review and launch and we're going to go ahead and hit launch.
Now we do need to create a key pair because we've never done this before.
So the way I like to think of public key and private keys.
This is asymmetric encryption.
So it means you need to see asymmetric with symmetry symmetric encryption it's just one sided with asymmetric
encryption.
You've got a public key and I want you to imagine that as a padlock and you can go and take your public
key and you can go and put it everywhere you can put on your bike you can put it on your front door
you can put on your neighbor's front door.
It doesn't matter if someone gets your public key your private key is the key that opens that padlock
and you do not want anyone else to get your private key because then they can open up all your padlocks
you can open up or your public keys zip public key will go on your easy to instance the private key
or save locally on your machine and you will use that private key to be able to access each into your
easy to instance.
So let's go ahead and create a new key pair.
I'm just going to call it my and the on my USCIS one US is one key key key player.
There we go.
So my use one KP.
I'm gonna go ahead and download that so download that to a safe location you will need it to connect
to your easy to instance.
So I've gone ahead and hit launch instance and I'm going to go in and view my instances so we can see
now that it's launching this is my instance I.D. you can see it's inherited the name from my tag we
can see the instance type is a T2 micro it's available in US e one D it's currently pending and the
status checks are initializing certainly go to DNS address.
So this is a web address that we can use to go and visit our easy to instance and down here we can see
you can move this so that it's bigger or smaller just by clicking these and we can see all our information
in here so we can see our public IP address for example we can see that it's in our VPC see what subnet
it's in et cetera et cetera et cetera and this will become more and more familiar to you as you go on
throughout the course and get your hands steady with AC 2.
Now I would copy this public IP address to a clipboard just clip on this little icon.
And now what we're going to do is we're going to assess reach into our easy to instance.
So there's actually a few different ways that we can connect in to our U.S. two instances we can use
terminal for Mac.
We can use a plug in for Chrome if you're using Windows for example but the the best way which is uniform
across both is just by clicking connect up here and using easy to instance connect and you can go ahead
and just hit connect your usernames always gonna be easy to hyphen user and go ahead and hit connect
that will open up a new tab and it will basically establish a session directly with your easy to instance
so we can see in here I'm already connected to it.
I can do things like sudo SMU to elevate my privileges to route and then I can go ahead and run some
updates et cetera et cetera.
I am going to show you how to do this using terminal using for Mac users as well as a plug in for Chrome
but just do whatever it is that you find best works for you throughout the rest of this course.
I'm going to be using terminal in my Mac.
The reason is as I've been using it for 10 years I'm very used to it and it's also a lot easier for
you guys to see the screen because they can adjust the tax make it larger.
Change the fonts etc but the easiest way probably for you guys is just to go ahead and hit connect and
then use easy to instance connect so Mac users are quickly show you how to use terminal to connect to
your easy to instance Windows users if you want to jump ahead to about 13 minutes and 30 seconds I'll
show you how to install a plugin for Google Chrome OS if we click on applications or we scroll all the
way down.
You'll be able to see utilities and in here we've got terminal.
Go ahead and open that up.
By default you'll be in your downloads directory and if you type in L S for list you'll be able to see
the files and folders in there.
Now I can see my key pair here it's called My u s e one keeper so I'm going to do as I'm just gonna
make a directory called SS H and I'm gonna move my US is one to my SS each directory and then I'm gonna
go into my SS H directory so city SS each and then I can see it in here.
Now what I'm going to do is gonna change the permissions I want to type C H mod and then 400 and then
my US is 1 keeper.
And you can hit TAB by the way.
That's how it will auto fill and that has just changed the permissions to lock.
MIKE He down and then what I'm going to do is I'm just going to clear the screen and we're gonna type.
SS H and then easy to hyphen user.
And then at.
And then we need to paste our IP address in there and then we need to do minus AI.
And then it was called My US S1 key player.
So basically we're connecting in as easy to user at this address using this keypad and ask if you want
to continue connecting here.
Yes.
And you should be able to connect in.
Now if you are having trouble some networks block port 22.
So you need to go and do this at home under a home network or do it on your you know on your phone or
something like that because some networks like hidden public libraries for example at schools or even
in your office they might be blocking port 22.
This is a common frustrating thing that some people get when they can't connect to their easy to instance
if it's not working it's probably because your networks blocking the port 22 you will be able to do
this at home though so have connected in and what I'm going to do is just elevate my privileges to route.
So we do that by typing sudo Eskew.
This will change my user you can see here it's gone from easy to use it to root and this basically gives
me super user access.
This gives me administrator access across the entire easy to instance but you shouldn't really do this
I know a lot of Linux admins will be looking at this saying all you should why don't you just type pseudo
for everything but for the rest this course I am gonna do it just because it makes the commands easier
and it makes it easier for beginners to follow along.
So again I'm going to go ahead and clear the screen.
OK so for Windows users what you need to do is go ahead and install google chrome as your browser and
then we're going to add a extension in Chrome which will basically turn our browser into an SSD each
client.
So what it wants you to do is once you've installed chrome go over to Google and just type in SS H chrome
extension into Google and go ahead and hit enter and in here you'll be able to see it's called the Secure
show out and I'll put this link in the resources section of the course.
So go ahead and click on that and then all we want to do is go ahead and download this extension.
So I'm gonna go ahead and hit add to Chrome that will then add this to Chrome.
Go ahead and hit add up and that will go ahead and install this extension into Chrome can take a little
bit a while so just wait for it to finish installing and there we go it has now installed now to get
to this extension you just need to navigate to Chrome colon forward slash forward slash and then apps.
That's how you are able to access your apps in Chrome and then we have it here.
It's the secure shell apps so go ahead and click on that.
And then what we want to do is we want to go in and configure this in order to connect real easy to
instance.
So the first thing we need to do is go ahead and grab the IP address.
So here's another easy to instance I've just spun up and I'm gonna go ahead and click back in here.
And so my username is just going to be easy too high for users to type that in.
Easy to hyphen user and then the hostname in here.
Just paste in our IP address and then what we need to do is go and create our identity.
Now in order to do that we need to navigate to where we installed or where we downloaded LP and file.
So let's.
Now we need to navigate over to the command prompt.
So just click on right click on the windows button.
Go ahead and hit run and then just type C NMD command that will fire up the command prompt you need
to navigate to where you installed or where you downloaded APM file size mines installed on the downloads
directory.
So I'm just going to go to my downloads directory so city downloads then I'm just going to type desire
and that will list everything in my directory and you can see here we've got my key pair so this one's
called My cape E M I'll just make this a bit bigger so you can see it.
And then all we want to do is we want to type the following commands.
We want to type in SS H hyphen ki Gen and then minus Y and then minus F and then we're going to type
the name of our key part key.
So it's my KP dot P.
And then we're going to output that to my KP and then dot pub.
So we're basically generating our public key.
So this is asymmetric encryption which means us have a private key and a public key a public key is
basically like a padlock you can give anyone a copy of that public key but they cannot open it up without
the private key and that's why you'd never hand out your private key to anyone because then they can
open up your public key.
That's the way I always like to think of it.
So we type in desire.
Now we can see our two files we've got my KP dot E M which is our private key and my KP dot pub which
is our public key.
The last thing we need to do is just rename the MAI KP dot p. m. to just my KP so you can give it any
name that you want.
You've got to lose the DOT P extension.
Once we've done that let's go back over to our to our Google Chrome extension so it's in here and then
we're gonna go ahead and hit import and then what you want to do is just navigate to your downloads
directory and import those two files.
Now again you must have changed that extension from DOT p. m. to just being called we're basically having
no extension.
Go ahead and hit open that will then change your identity to that key keypad and then you should be
able to just click in here.
I've lost my username and password again but I can just regenerate it and then we should be able to
go ahead and connect.
So if we're just enter it will now say it's loading the plug in connecting to that IP address just typing
yes and then it's going to add it to the list of known hosts and then we go we have logged in to our
easy to instance we can elevate our privileges and then we can go ahead and clear the screen.
And now you can follow along with all the commands in Windows as well.
And then what we're gonna do was going to apply some operating system updates.
So if we just type in Yum update minus Yes I see yum update minus Y it will just look for operating
system updates you can see here that I do not need any updates there's no security updates so this is
using the latest packages and then what I want to do is I want to install Apache suite type yum install
each TBD minus yes and that will go through and install Apache and Apache basically turns our easy to
instance into our web server.
Once you've done that you can be able to go to your city.
Var dub dub dub reached him Al directory and anything that you put in here will be basically a website
or be accessible over port 80.
So let's clear the screen and what we're going to do is we're going to create a little file we're gonna
call it nano and then index HMO Nanos just a text editor and I'm just gonna write some really quick
reached him out so be HMO had.
Not even going to go bother with body and all of that.
I'm just gonna say hello cloud gurus and we're going to end our header we're going to end our heat here
Mel and then control X and then hit yes and then hit enter and you'll be able to see that file in there.
So as soon as we turn on the Apache service or the heat TPD service this web server will become a basically
a web server and anyone will be able to go to our index start each team and sort of turn it on or we
need to do is type service he said TBD and then start and that will start the heat DVD service and then
you might just want to type a command called check config on check config on we'll just basically start
the heat TBD service if your if your easy to instance accidentally reboots you don't need to go in and
manually go in and turn it on at the next reboot so let's go ahead and test this by going over to a
Web browser.
Okay so here I am in a web browser and all I'm going to do is pasted my IP address hit enter and you
can see it.
Hello cloud gurus.
So we've created our very first little web server so I'm gonna end this lecture here.
You've done really really well.
You've got the time.
Please join me in the next lecture and we'll have a look at what else we can do with our easy two incidents
before we go in and terminate.
So if you've got the time please join me in the next lecture.
Thank you.