AWS EC2 Essentials: Setting Up and Accessing Your First EC2 Instance - Part 12

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
let's talk about the ec2 instances in our AWS Cloud so in this chapter we are just going to focus on what is ec2 instance what's the importance of it and how you can create your first ec2 instance and to give you a heads up we will be creating a Linux based ec2 instance as well as we will be creating a Windows based ec2 instance in this session but before that let's try to understand what's the ec2 instance is so ec2 instance is a virtual server so traditionally we have seen a physical ser server in our data centers but ec2 instance in AWS Cloud it's just a virtual server which is running into AWS cloud data center and these virtual servers can be run in any region so let's say you are present into Asia region then you will choose a nearest data center based on your geographical location so if you're present in any other Western Country Europe or America then you will be choosing the nearest data center present to your vinity so you just need to choose the region where you want to run your ec2 instances or your virtual server so it's just a virtual server uh which is running into your AWS Cloud but traditionally we had a physical server sitting somewhere into your company's own premise infra so that's the very basic difference between a ec2 instance with the traditional servers all right so now we know the ec2 instance and its significance because it is an virtual server but how about the memory CPU and the disk space how we are going to set up all those thing so in AWS you get all those features so in AWS you can set up your memory you can set up your storage you can set up your CPU and even you can set up your network networking for your ec2 instance as well so these everything are possible for your virtual server so it's just like you will be setting up all those thing one by one when you're are trying to start your virtual server which is a ec2 machine all right so how would you differentiate the different virtual server so in AWS we have a terminology which is like a T3 Nano T3 uh like a micro T3 small T3 large so these are some denomination which is given by AWS from their documentation and each uh denomination has a certain CPU configuration associated with it so as the name suggest Nano which will be very small instance uh micro will be a little bit bigger instance uh and the T3 small will be a little bit more bigger instance than the micro and eventually you will have a more higher CPU like a large or x large series also available so you just need to choose like what kind of a CPU you need uh or the what kind of a ec2 machine uh with that kind of a power you need so just select the correct size and then start provisioning which I'm just going to show to you like how you can start your own ec2 machine but yeah these everything things are possible uh uh in the setup stage and you can set up everything uh when you're trying to start your ec2 instance all right so this is my home uh page of my AWS console so in the search box how you would search for ec2 instances so you simply need to type ec2 over here and click on this ec2 option and here you will see uh the dashboard which is available for your ec2 configuration or ec2 control panel so this particular dashboard here you will see all the instances which are running and uh which we can set up or which we can also launch as a new instances so as of now the instances running count is zero which means I don't have any instance running so uh here if you click on this link then here you will find there are no instances which are running again go to the dashboard I would just like to give you a brief uh overview of this complete dashboard okay so uh there are some other option which we will take a look uh later uh we will just right now focus on this ec2 instance and how to get uh one instance running for you all right so the key thing over here is how to launch your ec2 instance so here you will find the option which is a launch instance so this is the option we are going to use to start our ec2 instance but before that I have mentioned about the region Point like in which region uh you need to create your ec2 install stand so here you can see as soon as you will sign up for your AWS account then these are the different different regions which you can choose so as I said uh we generally try to stick with the nearest region so here I'm choosing the stockh home region because I'm present into Stockholm so that's why I have choosen this is Stockholm region So based on your uh like geographical location try to choose the nearest data center or nearest region uh in your AWS okay so that's been said we are into the Europe region and this is the stockh home region where I'll be working so I will be provisioning or I will be starting my ec2 instance into my stockhome data center of AWS okay so how to start our ec2 instance so here you can click on this orange launch instance button so just click over here and here it will give you some options so first of all name and tag so this is an optional thing you can skip it also but for the time being I just don't want to skip these thing because this will help you to identify your ec2 instance so here I'm just going to put uh test demo uh AWS solution AAA series solution architect series I'm just putting a name and uh uh I'm just going to put I think that's good and after that once you specified the name of your E2 instance then you need to choose the operating system which you want to associate with your ec2 instance so here I'm just going to start uh let's say I'm just going to choose want to as my base operating system you can choose any any Linux operating system even Amazon Linux is also fine all right so just choose a operating system and here you can see this is the version which I will be using uh inside my ec2 instance which is UB to server 24.4 okay secondly the architecture so which architecture you want to go with so I'm just going with the 64bit x86 architecture even you can choose armm uh as well but I'm sticking with the X6 okay so here is the Ami uh which is a virtual image of your ec2 instance so that's the Ami ID which is uh for this ec2 instance okay then here as I have told you earlier that what kind of a uh CPU you want to or what kind of a power you want to associate with your ec2 instance so here I'm just going with the T3 micro which has like a 2 CPU 1 GB of memory and it considered into a free tire so I'm just going to stick with this one okay the second thing which is important which is a key pair so I generally recommend to use the key pair whenever you're working with the ec2 instances because these key pair will help you to login into your ec2 instance okay now how what is key pair so key pair is like there are two parts to it one is the public key and one is the private key and to simplify this whole uh key setup I have just just created two ident uh two objects over here on the left hand side you will see a developer which is like you or me uh and on the right hand side you will see a E2 instance which is also having a key so there are two key which I have created over here one is the red one and one is the green one so the red one is the private key which I always keep it with me and the public key is I always associate uh with my ec2 instance so whenever I'm talking about this keys and these keys will be used to SSH or to login into your ec2 instance so right now we are just trying to set up our ec2 instance so at the same time we need to uh create these keys so we will be creating this key pair and now I'm talking about the key pair then I will be creating a pair of keys which will have a public key and the private key so once I create a public key and private key then it will automatically attach this public key which you can see which is a Green Key to E2 instance but it will give you the private key for your download which you can keep it onto your local laptop or your workstation all right so let's get back to our AWS console and see so here you can see this is the key pair where we were trying to create so just click on create a new key pair and here you can enter the name of your key pairer and this name will be common for your public key and private key but the extensions will be different okay so I will put the name d demo ec2 as AA uh Series so this is the name of my key which I would like to put over here and after that the private key format I'm just going to stick with the pem extension and then click on create key pair and as soon as you down uh create this key pair then it has already downloaded which you can see over here it has already downloaded me the private key onto my local laptop all right and here in the drop down you will see the key has been attached and this key is your public key so this everything is happening uh on the go actually you can see so here now we are able to create a key pair public key is associated with our ec2 instance and the private key has been downloaded onto my local system we are going to use this key later so just keep in mind this key is already with me okay so as of now let's move to the next section which is our networking section so right now I'm just going with the default networking setup but in the upcoming chapter you will see I will be config configuring this whole E2 instance into our dedicated VPC subnet and then in the subnet also we will have a public and private subnet so we will be setting up this ec2 instance into those proper public as well as into our private subnet all right so but at the time being we just trying to understand our easy to instance so I will just keep everything default over here I'm not going to change anything over here security groups which is important and I would like to show you that you need to create a security group to SSH into to your ec2 instance so here uh as you can see uh like we have choose the option create Security Group allow SSH traffic from anywhere so whenever you see this IP range 0.0.0.0 me which means uh like anyone can access this particular ec2 instance because this IP range everywhere denotes that this resource is accessible to everyone so that's why this IP range is used here here and this IP range we are going to use quite a lot so just keep in mind this whenever you see this IP range which means from anywhere okay and here we are allowing the SSH so SSH happens on a port 22 so we are just checking up this box so that our SSH is enabled and we will be able to SSH or login into our easy2 install so these are the few settings which we are going with it okay after that the storage I'm just sticking with the 8 gigs which is sufficient enough for my demo and after after that advanced detail we are just going to take a look later because in that section we are going to take a look onto the user data section but as of now let's let's not focus on that part and what we are going to do we are just going to uh we are quite ready with our uh whole setup and this is the name of my ec2 instance which is this one and we have chosen linux2 as my base operating system after that we are going with 64bit X6 architecture T3 micro this is the key pair which we have created we have enabled the SSH on Port 22 from anywhere and after that I think we are quite good and also one more thing you need to set this one in uh aut to assign the public IP if you don't assign it then you will not be able to get the public IP and you will not be able to S into your ec2 instance so just keep in mind that this option is enabled if you are just setting it for the first time okay then click on this launch instance over here and it will take a couple of minute I'll be back once this is ready so here you can see the instance has been launched let's go and check so it is running right now so uh the health status check is still initializing so I'll be back in a couple of minute once it is ready all right so now my instance is up and running and the status check is passed and instance state is running so if you click on this instance ID then there are couple of details which you need to verify so this is our public IP which we will be using to SSH into my ec2 and Stander to login into my ec2 instance and this is the private IP which has been assigned and the state is running so as of now the details looks quite good and now we will be using our private key to SSH into this ec2 instance now to login or to SSH into your ec2 instance there are certain instruction which you can get once you click on this connect option over here so here you will find a couple of option like EC to instance connect session manager and SSH client so I'm just going to use the SSH client over here and these are the instruction which you need to follow to SSH into your ec2 instance and here the first thing is you need to have the key which you we have already downloaded so this is the key which we will be using so let me open my terminal because we will be logging into our Linux instance using our terminal so I will open my terminal over here and this terminal can be different for you uh this is just my Mac but in case if you're using any operating system like a windows then there will be like a uh sigin in your windows I think there is a tool called sigin uh in git which you can use which is exactly like a terminal onto your Windows machine if you're using Windows okay so anyway uh you just need to use any terminal uh which is available onto your operating system whether you it is a Mac whether it is a Windows it doesn't matter you just need to use the terminal all right so now uh what I'll do I'll just go to the directory where my key is there so I will just go to the directory and uh let me check so I need to go to the downloads directory and in the downloads I have a folder demo where I have already downloaded that key and here you can see this is the key which I have downloaded or when I created this key pair so this has been downloaded over here okay so let's follow the instructions once again over here so first of all we need to change the mode of that particular key because because that particular key has a very open permission so here if you take a look then this particular key has a read and write permission which you can see so we need to change this read and WR and we need to make it read only so I'm just going to copy this command from here and uh paste it over here and hit enter and let's check the permission and now you can see this is the read only right now okay I'm just going to clear the screen and uh I'm just going to follow the next instruction and this is the SSH command so just copy this SSH command and this SSH command will tell you like use this private key and this is the UB 2 which is your username and this is the uh URL which you need to or this is the uh private DNS uh of your ec2 instance sorry it is not a private but it is going to be your public DNS of your ec2 instance so that uh it can connect to that ec2 instance okay so just copy this command from here go to your terminal once again and the paste this command and after that hit enter and it will ask are you sure you want to connect so type yes and here you go you now you have logged in into your ec2 instance and if I clear it not clear it but I would like to show you first couple of things so this is the first thing which you need to verify this is your private IP which you can see 17231 3211 and which you can verify if you go over here so here you can see private IP 172 313 211 so that's your private IP okay and the same details which you can verify from here also so we have choosen the ubu 20.04 that's correct and uh here a couple of more thing which is like this is your uh DNS uh which you can also verify just copy this thing from here contrl F and control V and here you can see the public DNS okay and uh yeah so these are the a few details which you can verify from here so but anyway uh what I'm trying to convey the message over here is we are able to set up our ec2 instance and this ec2 instance is up and running and this ec2 instance we have set up using our Linux UB to uh Ami so this is how we start setting up our first V virtual server uh which is our Linux virtual server and uh I hope with this instruction you will be able to play around with your ec2 instances and my recommendation is just try to stick with the T3 micro or uh small instances if you're just doing it for the learning purpose okay so that was my first session on the ec2 instances uh in the next session we are going to take a look on how to set up the ec2 instances uh for Windows machine right now we have used UB to Linux machine but we are going to use the windows uh machine to set set up our ec2 instance and I'm just going to show you like how you can uh log into your Windows machine as well okay see you into the next session till then take care and bye-bye
Info
Channel: Rahul Wagh
Views: 1,038
Rating: undefined out of 5
Keywords: aws, aws solution architect, aws solution architect associate, aws solution architect professional, ec2, set up ec2, ec2 ssh
Id: Z_GmAszQAlI
Channel Id: undefined
Length: 18min 9sec (1089 seconds)
Published: Wed May 01 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.