Hello Techies
In this blog we are going to explore how to make some modifications on EC2 Instance.
As well all know EC2 Instance contains
-
NAME
-
AMI
-
INSANCE TYPE
-
KEY-PAIR
-
SECURITY GROUPS
-
NETWORKING CONFIGURATIONS
-
EBS VOLUME
In this blog, i am going to reveal how to modify NAME, INSTANCE TYPE, SECURITY GROUPS AND EBS VOLUME.
But what about others like AMI, Key-Pair & Networking configurations? can’t we change those for our instance?
For this i can say, directly it is not possible to change but technically there is a way to change which needs high end of configurations. That i am going to reveal on upcoming blogs.
Ok, lets make some modifications now
How to Change Name tags of our Instance
While launching the instance we can give the name to our instance. Some people will leave it blank and some people wants to change the Name of the instances
There are multiple ways to change the Name tags
- When you open the console, there is a direct option to change the name. Just go to instance and on the name you can find the pen symbol to edit it
See here i have changed this from MY-SERVER to MUSTAFA and click on tick symbol to save.
-
Let me tell you in another way, First select the instance and then you will get your instance details.
Now click on Tags and select manage tags
Now edit all the tags you want. These are my current tags and i am changing all the tags now.
Change the tags now and click on save
Now you can see Name is changed, lets see other tags also changed or not.
Select the instance and go to tags section.
As we can see every tag is changed.
So as of now we found 2 ways to change the instance name. lets explore the final way to change the name tags.
Select the Instance and click on Actions and select Instance settings and Click on Manage tags.
You will redirect to this page.
Now change the tags and click on save.
Now lets check weather it is changed or not, Select the instance and go to tags section.
How to change the Instance Type:
You are running a web application on t2.micro (1 CPU & 1 GB RAM) instance. Due to increased traffic, the application is experiencing slow performance. You decide to upgrade the instance type to t2.medium (2 CPU’S & 4 GB RAM) to improve performance.
To change the instance type from t2.micro to t2.medium, First we need to stop the instance. Because if our instance is in running state we can’t change the instance type.
To stop the instance, Select the instance and click on Instance state and select Stop Instance
Now click on stop
Now we can see our instance is in stopping state, Within a Minute it will turns to stopped state.
After successfully stopped the instance, click on Actions and select Instance setting and click on Change instance type.
You can see the exisiting instance type is t2.micro lets remove it and change this to t2.medium and click on change
Now we can see the instance type is change to t2.medium
Lets start the Instance, , Select the instance and click on Instance state and select Start Instance
Now we can see the instance is in pending state, within a short period of time (up to 30 sec), it will turns into running state.
Now we can connect our instance and start working as usual.
Note:
-
Once you restart (stop & start) the instance, the public ip of your instance will gets changed because AWS dynamically allocates public IPs. If you wish to restrict it we can use Elastic IP’s but this will not comes under free tier.
-
T2.medium will not comes under free tier limits, once after your practice change it from t2.medium to t2.micro as we did like t2.micro to t2.medium.
How to increase the EBS volume
A company is running a web application on an AWS EC2 instance using a 50 GiB Elastic Block Store (EBS) volume for data storage. Over time, the volume usage has reached 95%, and the application is facing storage constraints, impacting performance. The company decides to increase the EBS volume size to 100 GiB to accommodate future growth.
Let me tell you how to modify the EBS volume
Select the instance and go to storage tab
You can see the volume id like vol-046ce7c38c7456486
Click on volume-id, so you will redirect to EBS VOLUME page and select your volume.
Now click on Actions and select Modify volume
Initially i took 8GB of volume now i am changing this to 15 GB and click on modify twice.
Refresh the tab and now we can see the EBS volume is upgraded from 8Gb to 15Gb
Now on the left side menu click to instances
Now select your instance and click on Storage tab, we can see the volume is upgraded for our instance.
Note:
-
Once we modify the EBS volume for our instance, we must wait for 6 hours before making another change.
-
We can attach 28 EBS volumes for each instance.
How to modify Security groups:
A company has deployed a web application on an AWS EC2 instance in a public subnet. Initially, the security group associated with the instance allowed SSH (port 22) and HTTP (port 80) access from any IP address (0.0.0.0/0
). For enhanced security, the IT team decided to:
-
Restrict SSH access to the company’s office IP range only.
-
Allow HTTP access from any IP address.
-
Replace the existing security group with a more secure one.
To change the security groups, select the instance and click on security tab
Now we can see the security group id (sg-0c5c7868aa47f426b)
click on the id and you will redirect to another page
click on edit inbound rules option and add rules like http, https etc… and source should be Anywhere-IPv4
and click on save the rules.
We have successfully modified the security groups also.
NOTE:
- we can change existing security groups as per our requirement or we can create new security group and attach it to our instance.
If you love stories that inspire learning, growth, and productivity, consider subscribing for more! If this article added value to your journey, your support would mean the world to me — only if it’s within your means. Let’s stay connected on LinkedIn too. Thank you for reading!