Mastering EC2 Modifications: A Practical Guide for Cloud Enthusiasts


Amazon EC2 (Elastic Compute Cloud) offers unmatched flexibility when it comes to configuring virtual servers in the cloud. But launching an instance is just the beginning—real power lies in knowing how to modify it to suit evolving needs. Whether you're scaling resources, tweaking storage, adjusting security groups, or fine-tuning networking settings, understanding EC2 modifications is essential for optimizing performance and cost.
In this blog, we’ll walk through the most common and useful EC2 instance modifications—from resizing instance types to updating inbound/outbound rules and storage configurations. Whether you're a cloud beginner or sharpening your AWS skills, this guide will help you make confident, efficient changes to your EC2 setup.
Before we jump into modifying EC2 instances, let’s rewind the essential steps to launch one.
Log in to AWS Console & Launch a New Instance
1. Name & Tags: Tags help organize and manage your resources efficiently.
2. Amazon Machine Image: An AMI provides operating system, application server.
3. Instance Type: Determines hardware configuration of your EC2 virtual machine.
4. Key pair: Key pair in Amazon EC2 used to securely access your virtual machine.
5. Network Settings: This includes VPC configurations, availability zones and public IPs.
a) VPC
b) Subnet
c) Auto-assign public IP
d) Firewall(S.G)
e) Security group name
f) Inbound security group rules
6. Configure Storage: When you launch an EC2 instance, you can configure storage volumes for your instance.
These are key configuration options you’ll encounter when launching or modifying an EC2 instance. To get started, log in to your AWS Management Console and begin the process of launching and configuring your EC2 instance. If you're unsure how to do this, don’t worry—just follow the step-by-step guide provided in the section below.
https://cloudcompute.hashnode.dev/start-your-first-ec2-instance-with-these-simple-steps
Now, let’s dive into the nuts and bolts of EC2 customization and unlock the full potential of your cloud infrastructure. 🚀
🔄 How to Modify Name Tag of an EC2 Instance:
If you forgot to assign a name during instance creation or entered an incorrect name, you can easily modify it later using the steps below.
There are multiple ways to update the Name tag of your EC2 instance.
✅ Method 1:
→ Log in to your AWS Console.
→ Navigate to EC2 > Instances.
→ Select the instance whose name you want to change & click on the pen symbol.
→ Now edit the Name tag and click the checkmark to confirm. You’ll notice that the original name Server1, has now been updated to My server.
✅ Method 2:
→ Log in to your AWS Console.
→ Navigate to EC2 > Instances.
→ Select the instance whose name you want to change and click on Actions > Instance settings > Manage tags.
→ Under the Manage Tags section, you’ll see the current Value set to My server. To update it: Change MyServer back to Server1 & Click Save to apply the changes. You can also add additional tags by clicking the Add new tag button.
Here, you’ll notice that the Name tag has been changed from My server to Server1. Additionally, new key-value pairs have been added to help organize the instance further. If any tag is no longer needed, you can easily remove it by clicking the delete icon next to the tag.
✅ Once all changes are made, click Save to apply them.
🔄 If the changes aren’t immediately visible, click the Refresh button to update the view.
✅ Method 3:
→ Log in to your AWS Console.
→ Navigate to EC2 > Instances.
→ Select the instance whose name you want to change & Scroll down to the Tags section.
→ Click Manage Tags.
→ Locate the tag with the key Name, and update its Value to your desired name. (Same like Method 2)
→ Click Save to apply the changes.
💡 The Name tag is just a label—it doesn’t affect the instance’s functionality, but it helps you organize and identify resources easily.
📦 How to Expand the Storage Size of an EBS Volume:
For example, A startup is running a PostgreSQL database on an EC2 instance with a 30 GiB EBS volume. As user activity grows, the database size expands rapidly, and the volume usage hits 90%. Query performance begins to degrade due to limited space for temporary files and indexing. To prevent downtime and ensure smooth scaling, the company decides to increase the EBS volume size to 80 GiB.
So to modify EBS volume follow the below steps provided.
✅ Method 1:
→ Log in to your AWS Console.
→ Navigate to EC2 > Instances.
→ Select the instance and Scroll down to the Storage section.
→ Under the Storage tab, locate the Volume ID associated with your instance. Click on the Volume ID to open the volume details. Then, select the volume and click on Actions > Modify Volume to begin resizing.
Initially, the volume was set to 8 GB. I updated it to 10 GB and clicked Modify twice to confirm the changes.
"After refreshing the tab, the EBS volume now reflects the updated size—increased from 8 GB to 10 GB."
Verifying the Volume Upgrade on the Instance:
→ From the left-hand menu, click on Instances.
→ Select your instance and navigate to the Storage tab.
→ You’ll see that the attached volume has been successfully upgraded to 10 GB.
✅ Method 2:
→ Go to EC2 Dashboard in the AWS Management Console.
→ In the left panel, click Volumes under Elastic Block Store.
→ Select the volume you want to resize.
→ Click Actions > Modify Volume.
→ Enter the new desired size (in GiB) and click Modify.(Same as Method 1)
NOTE:
→ "EBS volumes cannot be reduced in size—for example, you can't shrink a volume from 10 GB to 8 GB or from 20 GB to 10 GB. You can only increase the volume size. Attempting to decrease it could result in data loss, which is why AWS does not support volume size reduction."
→ "After modifying an EBS volume, AWS requires a 6-hour waiting period before you can apply another change to that same volume."
→ "An individual EC2 instance supports the attachment of up to 28 separate EBS volumes."
🔄 How to Modify the Instance Type of an EC2 Instance:
You're currently running a web application on a t2.micro instance (1 vCPU & 1 GB RAM). As traffic increases, the application begins to lag due to limited resources. To enhance performance, you decide to upgrade the instance type to t2.medium (2 vCPUs & 4 GB RAM).
Before changing the instance type, the instance must be in a stopped state—AWS does not allow instance type modifications while it's running. Select your instance from the EC2 dashboard & Click on Instance State, then choose Stop Instance & Click on Stop.
→ Once the instance enters the stopping state, wait for about a minute until its status updates to stopped.
→ After the instance is fully stopped, click on Actions.
→ Navigate to Instance Settings > Change Instance Type.
→ In the dialog box, you'll see the current type set to t2.micro.
→ Replace it with t2.medium from the dropdown list.
→ Click on Change instance type.
→ You’ll now notice that the instance type has been successfully changed to t2.medium.
🚀 Starting the Instance:
→ Select your instance from the list.
→ Click on Instance State, then choose Start Instance.
→ The instance will move into the pending state.
→ Within approximately 30 seconds, its status will update to running.
→ Once it's running, you're all set to connect to the instance and resume your work as usual.
📌 Important Notes After Restarting the Instance:
→ When you stop and start an EC2 instance, its public IP address will change, since AWS assigns public IPs dynamically.
→ To maintain a fixed public IP, consider using an Elastic IP. However, keep in mind that Elastic IPs are not included in the free tier.
⚠️ Instance Type Reminder:
→ The t2.medium instance type is not covered under the AWS free tier.
→ After completing your practice or testing, it's recommended to switch back to t2.micro, just as you previously upgraded from t2.micro to t2.medium.
How to Update Security Groups in AWS EC2:
In this section, I will explain the difference between public and private IP addresses, and demonstrate how to update security groups in AWS.
How we use Public IP :
First select the instance and connect to the instance.
Let's install a web server on the instance. First, switch to the root user using the command sudo -i
. Use the command yum install httpd -y && systemctl start httpd
to install the Apache web server and start its service. (httpd web server we are installing)
Now, if you want to see the web server in action, copy the public IP of your EC2 instance and paste it into your browser. However, you won’t see any output yet, because although we've installed the httpd
web server, it's not displaying anything. Why is that? Let me explain.
Here, we're trying to access the application using the public IP of the EC2 instance. This IP points to the server where our web server is running. However, the server is protected by a security group. In the security group's inbound rules, we've only allowed SSH (port 22), which is used exclusively to connect to Linux machines via the terminal. This means HTTP traffic (port 80) is currently blocked.
Inside the server, the application will be running—but to access it, we need to use the correct port. For a web server, that port is 80. So, to reach the application, port 80 must be open. Currently, our security group does not allow traffic on port 80. Because of this, incoming requests are being blocked by the security group before they can reach the server. To fix this, we need to add an inbound rule for port 80 in the security group.
🔄 To Change the Security Group Assigned to an Instance:
To modify the security group, first select your EC2 instance. Then, go to the Security tab. Under this tab, click on the Security Group ID to open the security group settings.
Click on Edit inbounded rules
Click on Add Rule, then select HTTP from the dropdown menu. This will automatically set the port to 80. To allow access from any IP address, choose Anywhere (IPv4) instead of Custom. Finally, click Save Rules to apply the changes. Once the rule is saved, copy the Public IPv4 address of your EC2 instance and paste it into your browser's address bar. Refresh the page, and you should see your web application or server page load successfully.
If you want only yourself to access the instance, go to the Security tab and click on the Security Group ID. Then, click on Edit Inbound Rules. Instead of selecting Anywhere (IPv4), choose My IP and click on save rules. This will automatically detect and restrict access to your current public IP address, ensuring that only you can reach the instance.
If only a few people should be allowed to access your application, go to the Security tab and click on the Security Group ID. Then, click on Edit Inbound Rules. Select the Source as Custom, and enter the specific IP addresses followed by /32
(e.g., 203.0.113.5/32
). This ensures that only those exact IPs can access your application. Finally, click Save Rules. Now, only the specified IP addresses will be able to reach your server.
Private IPs cannot be accessed directly through a browser unless you're on the same private network.
To access a service running on a private IP from the server itself (or another machine in the same network), use the following command: curl http://<Private-IP>/ (curl http://172.31.12.174/)
(curl → check url). Replace <Private-IP>
with the actual IP address, such as 10.0.0.5
. This command sends an HTTP request to the server and returns the response in the terminal. (We are accessing with in the server)
If you want to remove port 80 from a security group, select the security group, click on Edit Inbound Rules, delete the rule associated with port 80, and then click Save Rules. This is how we modify Security groups.
→ We can either edit the current security group to fit our needs or create a new one and attach it to the instance.
Here’s a scenario where modifying security groups can improve security:
A company launched a web app on an EC2 instance in a public subnet. At first, the security group allowed anyone on the internet to connect using SSH (port 22) and HTTP (port 80). To make things safer, the IT team made a few changes:
✅ They limited SSH access so only people in the office could connect.
🌐 They kept HTTP open so anyone can visit the website.
🔄 They swapped the old security group for a new, more secure one.
NOTE: When an EC2 instance is stopped, you don’t pay for the instance itself—only for things like storage or IPs that are still attached.
Stop protection: To prevent others from stopping your EC2 instance, you can enable stop protection.
→ Go to Instances in the EC2 console & Select your instance.
→ Click Actions > Instance Settings > Change Stop Protection
Set it to Enable and click Save
Now, the instance can’t be stopped unless stop protection is disabled first. If you try to stop instance you will be seeing an error.
We can also enable terminate protection.
→ Go to Instances in the EC2 console & Select your instance.
→ Click Actions > Instance Settings > Change terminate Protection
Set it to Enable and click Save
To disable the STOP protection:
→ Go to Instances in the EC2 console & Select your instance.
→ Click Actions > Instance Settings > Change STOP Protection
→ Uncheck the Enable check box and click on SAVE.
To disable the Terminate protection:
→ Go to Instances in the EC2 console & Select your instance.
→ Click Actions > Instance Settings > Change terminate Protection
→ Uncheck the Enable check box and click on SAVE.
🤔 Can We Modify AMI, Key Pair & Networking? - Not directly—but technically, yes.
🔄 AMI: Can’t change it mid-flight. Clone with a new AMI instead.
🔐 Key Pair: No UI swap, but SSH tricks can help.
🌐 Networking: Security groups? Easy. Subnets/VPCs? Not so much—requires rebuild.
🧠 With some cloud wizardry, it’s all possible. Stay tuned—I'll reveal the hacks in upcoming posts!
🔚 Conclusion
Understanding how to modify EC2 instances—whether it's resizing volumes, changing instance types, updating security groups, or managing IP settings—is essential for maintaining performance, security, and cost-efficiency in AWS.
By mastering these core operations, you gain the flexibility to adapt your infrastructure to changing needs without downtime or risk. Whether you're optimizing for traffic spikes, tightening access controls, or managing billing, these skills empower you to run smarter, safer cloud environments.
Keep exploring, keep refining—and let your EC2 expertise grow with every click.
Coming up next: Detailed walkthrough of the key tabs you'll encounter when working with EC2 in the AWS Console —don’t miss it🎯!
😀Happy exploring…
Subscribe to my newsletter
Read articles from Chandana Reddy directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Chandana Reddy
Chandana Reddy
Hi, I'm Chandana—a curious soul navigating the world through study, reflection, and shared wisdom. My journey is rooted in self-education: exploring new ideas, skills, and perspectives that empower personal growth. I believe that learning isn’t limited to classrooms—it’s an everyday practice that transforms who we are and how we connect. Through writing, conversations, and community-building, I share insights and tools that help others learn with purpose and passion. I’m not just a student of life—I’m a contributor to its knowledge ecosystem.