In this blog, I will cover everything about the Linux EC2 Instance Service of AWS Amazon Web Services from scratch.
It will provide you with everything that you need to in order to work with EC2 Instance on the console.
Linux EC2 Instance
- EC2 stands for Elastic Compute Cloud.
- Virtual Machines in AWS are called instances.
- An EC2 instance is a virtual server in Amazon’s Elastic Compute Cloud for running applications on the Amazon Web Service infrastructure.
- It is a web service provided by AWS for secure and realizable compute capacity which has made deployment faster and easier.
- AWS provides a variety of instances with different configurations of CPU, memory, and storage depending on the needs of the user.
How To Create A Linux EC2 Instance
- Open the AWS console and Search for EC2 in the search bar and open it.
- Once you are at the EC2 Dashboard, click on Launch to launch an instance.
- Now under the Name, type Value as Webserver and Scroll Down. Tags are added just for specifying names in the key and value field.
- Choose Amazon Linux 2 AMI, select 64-bit (x86) architecture and Scroll Down.
Note: Here, in the above step we are selecting the Amazon Linux 2 AMI which is basically preconfigured with some tools installed on it as Amazon Linux 2 AMI comes with AWS CLI pre-installed. AWS CLI is basically the Command Line Interface provided by AWS to access any of their services using CLI. - For Select the micro instance type, if you want you may select another instance type but they are chargeable so we choose the t2.micro instance type which is eligible for the free tier and limited resources.
Note: Here we must choose the instance type as t2.micro because it is free tier eligible, i.e. you won’t be charged for running the instance with this instance type as we need to perform the labs being in the free tier. So, please make sure you select the t2.micro as the instance type else you shall be charged for running instances from Paid AMI. - Select an existing key-pair or create a new one, we will create a new one, enter the name of the Key-pair as Linux-Key and rest everything Default.
- Here we can Configure Network Settings as per our need. We will keep VPC and Subnets as default. Click on Edit on the right side.
- Click on Add Security Group Rule.
- Add HTTP, the source shall Anywhere 0.0.0.0/0 (IPv4) traffic.
Note: We add the HTTP rule here because we need to access our Webpage. As the communication for request and response between Webserver and Browser happens on port 80 which is HTTP. - Now review all the things you have Configured and Click on Launch Instance.
- Now Click on View all Instances.
- Here, you shall see your instance is launching and the Status check is Initializing, wait for some time.
- Refresh and you shall see your instance is Up and Running, and the Status check has changed to 2/2 checks.
Now, we have successfully created our first Linux Instance using EC2.
Note: Now, wait for the Status check of the instance to change to 2/2 checks pass as the instance is launching from an AMI and it needs time to install all the preconfigured things like AWS CLI and other tools. So, please wait till the Status check becomes 2/2 checks pass and then only proceed with further steps, and if the status check has not passed then you shall get an error in the further steps so please wait.
Note: Now we have launched the instance successfully, further we need to access the instance so, we have two ways of accessing an instance-
- Accessing via Browser using EC2 instance Connect.
- Accessing using Putty (a Secure Shell SSH client).
In further steps, we shall see both ways to access Linux EC2 instances.
Accessing EC2 Instance Using Browser SSH Connection
Note: Till now, we have launched an instance successfully, but we need to access it to run commands so for accessing our instance the easy way is you can access the CLI directly from the browser using the EC2 instance connect that we shall see in further steps.
- Select your Instance and Click on Connect.
- Under EC2 Instance Connect, let everything default and click on Connect.
- Now you shall be redirected to a new window and you shall see the Linux CLI.
Related Links/References:
- AWS Certified Solutions Architect Associate SAA-CO2
- Overview of Amazon Web Services & Concepts
- How to create a free tier account in AWS
- AWS Certified Solutions Architect Associate SAA-CO2
- Amazon Elastic File System User guide
Next Task For You
Begin your journey towards becoming an AWS Certified Solutions Architect Associate SAA-CO2 by checking our FREE LIVE CLASS.
Click on the below image to download our FREE Live CLASS
The post All You Need To Know About a Linux EC2 Instance appeared first on Cloud Training Program.