> ## Documentation Index
> Fetch the complete documentation index at: https://cloud-architect.ipoint-labs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrading and Downgrading an EC2 Instance Type

> Hands-on lab · 30m

Launch this lab in the IP Lab Portal, then follow the steps below in the AWS console.

<a className="ip-lab-portal-btn" href="https://labs.intellectualpoint.com/labs/upgrading-and-downgrading-an-ec2-instance-type" target="_blank" rel="noreferrer">
  Open IP Lab Portal
</a>

## Overview

### Lab details

1. This lab walks you through how to upgrade and downgrade the EC2 Instance type when the traffic changes.
2. Duration: **30 minutes**
3. AWS Region: **US East (N. Virginia) us-east-1**

### Introduction

#### What is an EC2 Instance Type?

* Instance types comprise varying combinations of CPU, memory, storage, and networking capacity and give you the flexibility to choose the appropriate mix of resources for your applications.
* Each instance type includes one or more instance sizes, allowing you to scale your resources to the requirements of your target workload.
* There are different types of instance types :

  * General Purpose :-  These instance types are ideal for new users. They give a better understanding of what are the compute, memory, and networking requirements of your applications, run stress tests, and can move to advanced instance types.
  * Compute Optimized :- These are used when high performance processors are needed. Use cases include batch processing workloads, media transcoding, high performance web servers, high performance computing (HPC), scientific modeling, dedicated gaming servers and ad server engines.
  * Memory Optimized:- Memory-optimized instances offer a large memory size designed for memory intensive applications including in-memory applications, in-memory databases (such as SAP HANA), in-memory analytics solutions, High Performance Computing, Electronic Design Automation, scientific computing and enterprise applications.
  * Storage Optimized:- Storage optimized instances are designed for workloads that require high, sequential read and write access to very large data sets on local storage. They are optimized to deliver tens of thousands of low-latency, random I/O operations per second (IOPS) to applications.
  * Accelerated Computing:- Accelerated computing instances use hardware accelerators, or co-processors, to perform functions, such as floating point number calculations, graphics processing, or data pattern matching, more efficiently than is possible in software running on CPUs.
* Sometimes there is a need to change the EC2 instance type due to sudden traffic change and due to which , the need for vCPUs, memory(GiB), network bandwidth etc. So It is important to learn how to change the EC2 instance type.

### Architecture diagram

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/001.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=274928e5400ff39488dadafe7a034d8a" alt="" width="1920" height="1080" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/001.png" />

### Task details

1. Sign into AWS Management Console
2. Launching an EC2 Instance
3. Upgrading Instance type from t2.micro to t2.medium
4. Downgrading Instance type from t2.medium to t2.micro
5. Validation of the lab
6. Deleting AWS Resources

### Launching the lab environment

1. To launch the lab environment, Click on the **Launch lab** button.
2. Please wait until the cloud environment is provisioned. It will take less than a minute to provision.
3. Once the Lab is started, you will be provided with IAM user name, Password, Access Key, and Secret Access Key.

<Note>
  You can only start one lab at any given time.
</Note>

## Lab guide

### Lab steps

#### Task 1: Sign in to AWS Management Console

1. Click on the **Open console** button, and you will get redirected to AWS Console in a new browser tab.
2. On the AWS sign-in page,

   * Leave the Account ID as default. Never edit/remove the 12-digit Account ID present in the AWS Console. otherwise, you cannot proceed with the lab.
   * Now copy your **User Name** and **Password** in the Lab Console to the **IAM Username and Password** in AWS Console and click on the **Sign in** button.
3. Once Signed In to the AWS Management Console, Make the default AWS Region as US East (N. Virginia) us-east-1.

#### Task 2: Launching an EC2 Instance

1. Make sure you are in the **US East (N. Virginia) us-east-1** Region.
2. Navigate to **EC2** by clicking on the **Services** menu in the top, then click on **EC2** in the **Compute** section.
3. Navigate to **Instances** on the left panel and click on **Launch instances** button.
4. Name : Enter **MyEC2Server**

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/002.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=5e40a42c485aaec0dc18b824a765f971" alt="" width="975" height="190" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/002.png" />

5. For Amazon Machine Image (AMI): Search for **Amazon Linux 2023 AMI** in the search box and click on the **Select** button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/003.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=daf3e4ff34705e2d3e1478a8abcac0a3" alt="" width="884" height="439" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/003.png" />

**Note: if there are two AMI's present for the Amazon Linux 2023 AMI, choose any of them.**

6. For Instance Type: Select **t2.micro**

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/004.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=59025476dd3a26b9ed72b20a5ae30865" alt="" width="971" height="260" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/004.png" />

7. For Key pair: Select **Create a new key pair** Button

* Key pair name: Enter **WhizKey**
* Key pair type: Select **RSA**
* Private key file format: Select **.pem**

8. Select **Create key pair** Button.

#### <img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/005.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=33b7ff9573d3e5c3cda60ab7b318e1ca" alt="" width="750" height="780" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/005.png" />

9. In Network Settings Click on **Edit** Button:

* Auto-assign public IP: Select **Enable**
* Select **Create security group.**
* Security group name: Enter **MyEC2Server\_SG**
* Description: Enter **Security group to allow traffic to EC2.**

### <img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/006.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=e18422f617cc610e1e3a8ba832e0fbbd" alt="" width="975" height="472" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/006.png" />

* For **Inbound Security group rules**, Choose Type: **SSH** and Source: Select **Anywhere**

  <img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/007.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=bfd0b4d61dbf598fe28f6ec9a173eda4" alt="" width="1191" height="309" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/007.png" />

10. Keep Rest thing Default and Click on **Launch Instance** Button.
11. Select **View all Instances** to View the Instance you Created
12. Launch Status: Your instances are now launching, Navigate to Instances page from left menu and wait the status of the EC2 Instance changes to **running**.

#### <img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/008.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=838df734b8b9730aad9e06f5726c9f87" alt="" width="1555" height="231" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/008.png" />

#### Task 3: Upgrading Instance type from t2.micro to t2.medium

In this task , we will change the instance type from t2.micro to t2.medium. t2.micro contains 1 vCPU, 1 GiB memory and 6 CPU credits/hour. t2.medium contains 2 vCPUs, 4 GiB memory and 24 CPU credits/hour.

1. Make sure you are in the **US East (N. Virginia) us-east-1** Region.
2. Navigate to **EC2** by clicking on the **Services** menu in the top, then click on EC2 in the Compute section.
3. As we cannot change the instance type when the EC2 Instance is in running state, therefore we have to stop the instance first, and then we can change the instance type.
4. Select the EC2 Instance and click on **Stop Instance** under **Instance State** Button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/009.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=a1fb3d6fffeaa4223e8007295baee358" alt="" width="1531" height="301" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/009.png" />

5. Click on the **Stop** button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/010.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=f505afacfdad51ef3fde9adcf7adaedf" alt="" width="830" height="346" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/010.png" />

6. Once the Instance state of EC2 instances changes to Stopped, select the EC2 instance and click on **Instance settings** under the **Actions** button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/011.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=d849e41c65adf5dfad0a4989c0bb0024" alt="" width="1551" height="398" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/011.png" />

7. Click on the **Change instance type** button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/012.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=ba1aa7c50c5f527d704274868879e3b4" alt="" width="1562" height="480" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/012.png" />

8. Select the **t2.medium** from the Instance type dropdown. Click on the **Change** button.

9. You can see the instance type changed successfully.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/013.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=032c508842938b1ad8433d5452613f25" alt="" width="1545" height="284" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/013.png" />

10. Now we can start the instance again. Select the EC2 Instance and click on **Start Instance** under **Instance State** Button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/014.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=aa69b29f33df3485d5f44151045ef5bd" alt="" width="1544" height="275" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/014.png" />

#### Task 4: Downgrading Instance type from t2.medium to t2.micro

1. Make sure you are in the **US East (N. Virginia) us-east-1** Region.
2. Navigate to **EC2** by clicking on the **Services** menu in the top, then click on **EC2** in the **Compute** section.
3. As we cannot change the instance type when the EC2 Instance is in running state, therefore we have to stop the instance first and then we can change the instance type
4. Select the EC2 Instance and click on **Stop Instance** under **Instance State** Button.
5. Click on the **Stop** button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/015.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=4fad5bb4e2d3704dbe7bf0b4e584d337" alt="" width="830" height="346" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/015.png" />

6. Once the Instance state of EC2 instances changes to Stopped, select the EC2 instance and click on **Instance settings** under the **Actions** button,

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/016.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=4aa3260293fb5035e12c5279612e71e7" alt="" width="1543" height="401" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/016.png" />

7. Click on the **Change instance type** button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/017.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=1d3cea18c876e7047593806f732e09cf" alt="" width="1545" height="451" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/017.png" />

8. Select the **t2.micro** from the Instance type dropdown. Click on the **Change** button.

9. You can see the instance type changed successfully.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/018.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=0acbfda59804f08dac4ba0fa948fb8f0" alt="" width="1558" height="285" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/018.png" />

10. Now we can start the instance again. Select the EC2 Instance and click on **Start Instance** under **Instance State** Button

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/019.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=e39c3f087ee09e54a9907b6ba49a9150" alt="" width="1544" height="275" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/019.png" />

11. You can see the instance running.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/020.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=f046a02589af76d4b09e73bf32ad8852" alt="" width="1534" height="231" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/020.png" />

<Tip>
  **Do you know?**

  The instance retains the same private IP address, Elastic IP (if attached), and other configuration settings after the resize operation is complete.
</Tip>

#### Task 5 : Validation Test

1. Once the lab steps are completed, please click on the **Check my work** button on the left side panel.
2. This will validate the resources in the AWS account and displays whether you have completed this lab successfully or not.
3. Sample output :

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/021.gif?s=3c134c70182be29df3402e2d164952f0" alt="" width="1000" height="441" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/021.gif" />

#### Task 6: Deleting AWS resources

1. Make sure you are in the **US East (N. Virginia) us-east-1** Region.
2. Navigate to **EC2** by clicking on the **Services** menu in the top, then click on **EC2** in the **Compute** section.
3. Select the EC2 Instance and click on **Terminate Instance** under **Instance State** Button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/022.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=cc2dbfb06dcd17c623557dd524098cef" alt="" width="1552" height="281" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/022.png" />

4. Click on the **Terminate** button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/iAkc8cvYvGsOYFCQ/images/labs/upgrading-and-downgrading-an-ec2-instance-type/023.png?fit=max&auto=format&n=iAkc8cvYvGsOYFCQ&q=85&s=aca2339bbfabd61dd4283e13d53dab91" alt="" width="831" height="482" data-path="images/labs/upgrading-and-downgrading-an-ec2-instance-type/023.png" />

### Completion and conclusion

1. You have created an EC2 Instance.
2. You have successfully upgraded EC2 Instance type.
3. You have successfully downgraded EC2 Instance type.
4. You have deleted all the AWS resources.

### End lab

1. Sign out of AWS Account.
2. You have successfully completed the lab.
3. Once you have completed the steps, click on **End lab** in the IP Lab Portal.

## What gets checked

When you press **Check my work**, the platform verifies each of these:

* **Launch an EC2 Instance** — Check whether an EC2 Instance is launched or not.
* **Launch EC2 AMI type Amazon Linux** — Check whether the EC2 instance is launched using an Amazon AMI.
* **Validate EC2 Instance Type t2.micro** — Check whether the EC2 instance type is t2.micro.

## Related help

* [FAQs and Troubleshooting](/aws-cp/support/faqs-and-troubleshooting)
