Mastering the Art of Instance Management: A Comprehensive Guide to Creating and Terminating Instances Like a Pro!
Published: 2023-04-06 10:22:52

Amazon Elastic Compute Cloud (EC2) is a cloud computing service that provides scalable computing capacity in the Amazon Web Services (AWS) cloud. It is designed to make web-scale cloud computing easier for developers. With EC2, you can launch instances of virtual machines, also known as instances, on Amazon's infrastructure. This allows you to quickly and easily spin up virtual servers to run your applications, store your data, or even host your website. In this blog post, we'll walk you through the steps to create and terminate an EC2 instance using the EC2 dashboard.

## CREATING AN INSTANCE

### Step 1: Sign in to the AWS Management Console

To create an EC2 instance, you first need to sign in to the AWS Management Console. If you don't have an AWS account, you can create one by following the instructions provided on the AWS website.

### Step 2: Open the EC2 Dashboard

After you have logged in to the AWS Management Console, you can go to the EC2 dashboard by selecting the "EC2" service located in the "Compute" category of the console. This will direct you to the EC2 dashboard, where you can oversee your EC2 instances.

### Step 3: Launch Instance

On the EC2 dashboard, click the "Launch Instance" button to start the process of generating a new instance. This will direct you to the "Launch Instance Wizard", which will guide you through the process of selecting the instance type, configuring the instance particulars, and launching the instance.

### Step 4: Choose an Amazon Machine Image (AMI)

The initial stage in the "Launch Instance Wizard" is to select an Amazon Machine Image (AMI), which is a pre-configured virtual machine image that encompasses an operating system and any supplementary software you need to execute your application. You can choose from a broad range of AMIs, including Linux, Windows, and other operating systems.

### Step 5: Choose an Instance Type

The next step is to select an instance type, which determines the amount of Central Processing Unit (CPU), Random Access Memory (RAM), data storage,and networking capacity that your instance will possess. You can choose from a wide range of instance categories, including general-purpose, compute-optimized, memory-optimized, and storage-optimized instances.

### Step 6: Configure Instance Details

After selecting an Amazon Machine Image(AMI) and an instance type, you can configure the instance details, including the number of instances you want to launch, the network settings, and any additional storage you need.

### Step 7: Add Storage

If you require an additional storage for your instance, you can add it in this step. You can choose from a variety of storage alternatives, including Amazon Elastic Block Store (EBS) volumes and instance store volumes.

### Step 8: Configure Security Group

The next step is to configure the security group for your instance, which determines the network access to your instance. You can either create a new security group or use an existing one. It is advisable to utilize the default or an existing security group.

### Step 9: Review Instance Launch

Before launching your instance, you can review all the configurations to ensure that everything is correct. Once you are satisfied, click the "Launch" button to start the instance.

### Step 10: Connect to Your Instance

After you launch your instance, you can connect to it using a remote desktop client or SSH client. You can also use the AWS Management Console to connect to your instance. This is what a functioning instance appears like:



![Successful running instance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lclehrw65n5ojjidmbse.png)


## TERMINATING AN INSTANCE

1. Navigate to the EC2 dashboard.
2. Select the instance that you want to terminate.
3. Click the "Actions" button and choose "Instance State" > "Terminate".
4. Confirm that you want to terminate the instance by clicking "Yes, Terminate".

AWS will request for your confirmation to terminate the instance before proceeding. Once you give the confirmation, AWS will initiate the termination process, which may take a few minutes to finish. Throughout this period, you will be unable to access the instance, and any active tasks or information on the instance will be lost forever.


![Terminating instance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qjkzzphjpxzxmzuugeke.png)


After the termination process is finished, the instance will be erased permanently from your account, and you won't be billed for its usage beyond the present billing cycle. Nevertheless, you will need to manually delete or clean up associated resources, like Elastic Block Storage(EBS) volumes or security groups, to avoid incurring unwanted charges.