How to launch a new EC2 instance on AWS?

Latest Blogs On Software Testing 2022

An EC2 instance is a web server or a virtual machine in the AWS infrastructure. It stands for Elastic Compute Cloud. It is the most popular service in AWS.

Pre-requisites to launch an EC2 instance:

  • The user launching the EC2 instance should have proper IAM Access policies or should be the root user to launch the instance.
  • Check the region of the AWS account as the EC2 instance is region scoped.

Steps to launch an EC2 instance:

  1. Select EC2 from the compute category of the AWS services.
  2. Select the Launch Instance option from the EC2 dashboard.
  3. Choose the Amazon Machine Image (AMI).
  4. Choose the instance type.
  5. Configure instance details.
  6. Add Storage.
  7. Add tags.
  8. Configure security groups.
  9. Review and launch the instance.
  10. Create/choose a key pair.

1.Select EC2 from the compute category of the AWS services

Step by Step Guide to Setup Amazon EC2 Instance

AWS has around 250 services; all these services are categorized based on their usage. Since EC2 is a web server or virtual machine, we can find it under the compute category.

2.Select the launch instance option from the EC2 dashboard

Step by Step Guide to Setup Amazon EC2 Instance
Once in the EC2 dashboard, we need to click on the launch instance option to create a new instance.

3.Choose the Amazon Machine Image (AMI)

Amazon Machine Image (AMI)

AWS has many Amazon machine images; AMI is nothing but the operating system such as Ubuntu, Linux, Windows, Mac OS, etc. So we can select any AMI we desire to use for our EC2 instance.

4.Choose the instance type

Instance Types

After selecting the AMI, we need to choose an instance type; there are around 750 instance types in AWS, and each instance has its configuration and is different from the other instances. It has attributes such as Type, vCPU, Memory, Instance Storage, Network Performance etc. We can decide the type of instance based on our application requirement. AWS also provides some instances for the free tier.

5.Configure instance details

Step by Step Guide to Setup Amazon EC2 Instance

Here, we can configure our instance details such as the number of instances to be created, purchasing options, placement group, and other network settings. We can also install the software we require our EC2 instance to have; this can be done by specifying the user data. The user data will run only once, i.e., at the first booting of the instance, where it performs all the operations specified in the user data.

6.Add Storage

Step by Step Guide to Setup Amazon EC2 Instance

The next step is to add additional storage to our instance; our instance comes with a default root EBS volume. If the user wants more storage, they can create a new EBS volume of any type by clicking on add storage.

7.Add tags

Step by Step Guide to Setup Amazon EC2 InstanceThe next step is to add tags, and this is optional. AWS allows us to add up to 50 tags. Each tag represents a case-sensitive key-value pair.

8.Configure security groups

Step by Step Guide to Setup Amazon EC2 Instance

Security groups are the networking fundamentals in AWS. It is the firewall between the EC2 and the internet. We can create and assign a new security group to the EC2 instance or attach an existing security group. This is used to specify who will have access to our EC2 instance. A default SSH rule will be specified while creating it; we can add additional rules such as HTTP or HTTPS and set the source IP address to allow access. (we can also attach an existing security group instead of the IP addresses).

9.Review and launch instance

Step by Step Guide to Setup Amazon EC2 InstanceAll the details entered in the previous steps will be displayed here; you can review and make any changes before you launch your instance.

10.Create/choose a key pair

Step by Step Guide to Setup Amazon EC2 Instance

The last step is to create or choose an existing key pair; the key pair combines a public key and a private key file. The AWS stores the public key, and the user will store the private key file; the private key file will have the extension “.pem.” For Windows AMIs, this file is required to obtain the password used to log on to the EC2 instance. For Linux AMIs, this file is required to securely SSH into the EC2 instance.

On clicking the launch instance, our instance will be created.

Final Thoughts
There’s a lot that goes into launching a new EC2 instance, but following these steps will help you get started on the right foot. Be sure to read through the Amazon EC2 documentation to get a more complete understanding of all the options and settings available to you. A lot of people have had great success with Testleaf’s AWS certification training online in Chennai. The success rate has been really high, which is great news for anyone looking to get into this field.

Leave a Comment

Your email address will not be published. Required fields are marked *

Accelerate Your Salary with Expert-Level Selenium Training