Create EC2 Instance with Amazon Linux.While creating we create new KeyPair (.pem) and create new Security Group to access EC2 Instance. NOTE: Make Sure you Login to AWS Management Console
-
1.
open AWS Management Console
-
2.
To Create EC2 Instance follow the steps: Click "Services" # EC2 Instance An EC2 instance is a virtual server that you can rent from Amazon Web Services (AWS) to run your applications on the cloud.
-
3.
Click " Compute"
-
4.
Click "EC2"
-
5.
Click "Instances"
-
6.
Click "Launch instances"
-
7.
Type Name for your Instance and click Next to continue. e.g. My Web Server
-
8.
Click/Select "Amazon Linux" and click Next to continue. # Amazon Linux 2023 Amazon Linux 2023 is the next generation of Amazon Linux from Amazon Web Services (AWS). It provides a stable, and high-performance execution environment to develop and run cloud applications. With Amazon Linux 2023 (AL2023), you get an application environment that offers long term support with access to the latest innovations in Linux
-
9.
Click and Select "Amazon Linux 2023 AMI" - "Free tier eligible" and click Next to continue.
-
10.
Click and select the size of the Instance. Click Nex to continue.
-
11.
Click "Create new key pair" # Create key pair To create a new key pair, enter a descriptive name, and specify the key pair type and the file format.
-
12.
Enter key pair name and click Next to continue e.g. my server key
-
13.
Click/Select "RSA" and click Next to continue. #Key pair type: Amazon EC2 supports ED25519 and RSA key pair types. ED25519 keys are not supported for Windows instances.
-
14.
Select ".pem"/".ppk" and click Next to continue. # Private key file format The file format defines the format of the private key that you will be prompted to "download" when you create the key pair. If you will use OpenSSH to connect to your instance, you must save the key in the .pem format. If you will use PuTTY to connect to your instance, you must save the key in the .ppk format.
-
15.
Click "Create key pair" Note: The "keypair file" will be downloaded into your local PC
-
16.
Click "Edit" to edit Network Settings. Note: You can configure networking options, including VPC, subnet, security groups, and other advanced settings.
-
17.
Select the VPC that you want to launch your instance into and click Next to continue.
-
18.
Click and Select the Subnet (Availability Zone) - The subnet in which the network interface is located. Note: You can Leave "No Preference" if you do not want to select any specific subnet Click Next to continue.
-
19.
Click and Select Enable to connect EC2 Instance to Internet or Select Disable to keep it Private. Click Next to continue. # Auto-assign public IP Whether a public IP address is automatically assigned to the primary network interface of the instance
-
20.
To create new Security group, click "Create new Security Group" # Security groups A security group is a set of firewall rules that controls the traffic to and from your instance. Inbound rules control the incoming traffic to your instance, and outbound rules control the outgoing traffic from your instance.
-
21.
Change Security Group Name as required and click Next to continue. e.g. mySG or Leave the existing name
-
22.
Make Sure "SSH" is selected, otherwise search and select SSH. As we are using Amazon Linux here, we have to access it by SSH protocols Click Next to continue. # The network traffic type. When you select a traffic type, the Protocol field is automatically filled in. Depending on the type that you select, the port or port range are either predetermined or open so that you can enter a custom port or port range. Common traffic types include SSH (for a Linux instance), RDP (for a Windows instance), and HTTP and HTTPS (to allow Internet traffic to reach your instance).
-
23.
Click "Launch instance"
-
24.
Click View all instances
-
25.
Search for your instance from the below list and wait till your Instance Status shows "Running" and status check is "2/2". Click Refresh to verify the status. **Once your Instance passed the status check, click on the checkbox against your newly created EC2 instance and Click Next to continue**
-
26.
Here if you can see public DNS address for your EC2 Instance, then EC2 creation is successful. Click Here to Copy your Instance's DNS Name. # To connect the Instance: Use Putty app or WebSSHClient ( https://ssheasy.com/)