
Amazon EC2 β From Launching a VM to a Complete AWS Configuration πππ
One of the most important parts of my AWS Solutions Architect learning journey is understanding Amazon EC2. EC2 gives us virtual servers in the AWS Cloud, but launching an EC2 instance is more than simply clicking Launch. We need to make decisions about the AMI, instance type, network, security, storage, authentication, and cost model. In this article, I'll walk through the complete process of creating an EC2 Linux VM and explain what to select, why to select it, and when that choice makes sense.
Day 5: Amazon EC2 β From Launching a VM to a Complete AWS Configuration π
One of the most important parts of my AWS Solutions Architect learning journey is understanding Amazon EC2.
EC2 gives us virtual servers in the AWS Cloud, but launching an EC2 instance is more than simply clicking Launch. We need to make decisions about the AMI, instance type, network, security, storage, authentication, and cost model.
In this article, I'll walk through the complete process of creating an EC2 Linux VM and explain what to select, why to select it, and when that choice makes sense.
βοΈ What is Amazon EC2?
Amazon EC2 (Elastic Compute Cloud) provides resizable compute capacity in AWS.
Think of an EC2 instance as a virtual machine where we can run:
- Web servers
- APIs
- Applications
- Development environments
- Databases
- Automation workloads
- Custom software
The important part is that we control the configuration of the server.
1. Choose the AWS Region
Before launching an instance, select the AWS Region.
For example:
ap-southeast-1 β SingaporeThe Region matters because it affects:
- Latency
- Availability Zones
- Service availability
- Data residency
- Pricing
- Network architecture
What should you select?
For learning, choose a Region geographically close to your users or development environment.
For production, choose based on latency, compliance, service availability, disaster-recovery requirements, and cost.
2. Name and Tags
Give the instance a meaningful name.
For example:
1
MGMT-EC2-PUB-01or:
1
DEV-WebServer-01The EC2 console uses the Name value as a tag. Additional tags can be used for environment, application, owner, cost center, and other organizational purposes. (AWS DocumentationΒ )
A good tagging strategy becomes extremely useful when managing many AWS resources.
3. Choose an AMI
Next comes the AMI β Amazon Machine Image.
An AMI is a template containing the information needed to launch an EC2 instance, including the operating system and associated configuration. (AWS DocumentationΒ )
For a Linux learning environment, you could choose:
Amazon Linux
Other options may include Ubuntu, Windows Server, and specialized images.
Which AMI should you choose?
| Requirement | Typical choice |
|---|---|
| AWS/Linux learning | Amazon Linux |
| Ubuntu-specific application | Ubuntu |
| Windows application | Windows Server |
| Preconfigured software | Appropriate marketplace/custom AMI |
For a first AWS Linux VM, Amazon Linux is a straightforward starting point. (AWS DocumentationΒ )
4. Choose the Instance Type
This is where we select the virtual hardware.
The instance type determines resources such as:
- vCPUs
- Memory
- Networking capability
- Storage characteristics
AWS provides different instance families for different workloads. (AWS DocumentationΒ )
For learning
Choose a small, Free Tier-eligible option when your account and Region qualify rather than unnecessarily launching a large instance.
AWS's current Free Tier eligibility depends on when the account was created, so check the EC2 console's Free Tier eligibility label and current AWS Free Tier terms before launching. (AWS DocumentationΒ )
For production
Don't simply choose the smallest instance.
Instead:
Workload β CPU/Memory requirement β Performance testing β Right-size
5. Key Pair β How Will You Log In?
For Linux EC2 instances, a key pair can be used for secure authentication.
You can:
- Select an existing key pair
- Create a new key pair
If you create a new one, securely store the private key.
AWS specifically warns that proceeding without a key pair can prevent normal key-based access unless the AMI provides another login mechanism. (AWS DocumentationΒ )
For a learning Linux server, I would normally create/select the appropriate key pair before launching.
6. Configure the VPC
Now we reach one of the most important architectural decisions:
Where should the EC2 instance live?
Select:
VPC β Subnet
For example:
1
2
VPC: 10.0.0.0/16
Subnet: 10.0.1.0/24The subnet determines the network location of the instance.
For a production architecture, don't blindly use the default VPC. Select the VPC and subnet designed for that workload. AWS allows you to choose an existing VPC and subnet during launch. (AWS DocumentationΒ )
7. Public IP Address
You may see an option to automatically assign a public IPv4 address.
When would you use it?
For a simple learning server that needs direct internet connectivity, a public IPv4 address can make testing easier.
For production:
Don't automatically give every EC2 instance a public IP.
Private application servers generally don't need direct inbound internet access.
A common architecture is:
1
2
3
4
5
Internet
β
Load Balancer
β
Private EC2This is generally preferable to exposing every application server directly.
8. Security Group
The Security Group is effectively the network firewall associated with the instance's network interface.
For a Linux web server, you might allow:
1
2
3
SSH β TCP 22
HTTP β TCP 80
HTTPS β TCP 443But here's an important security lesson:
Don't blindly use:
1
0.0.0.0/0for SSH access in production.
If SSH is required, restrict the source to a trusted IP range where practical, or use a more appropriate management/access architecture.
AWS's own EC2 tutorials demonstrate SSH rules, but production configurations should be designed around the actual access requirement rather than simply opening ports to everyone. (AWS DocumentationΒ )
9. Configure Storage β EBS
Next we configure storage.
The root volume is commonly an EBS volume.
You can configure:
- Volume size
- Volume type
- Encryption
- Delete-on-termination behavior
For a basic Linux learning VM, the default root EBS configuration is often sufficient.
For production, select storage based on:
Capacity + IOPS + throughput + durability + cost + workload pattern
Don't provision hundreds of GB simply because you can.
10. Advanced Details
The Advanced Details section contains additional configuration options.
Depending on the use case, these can include settings such as:
- IAM instance profile
- User data
- Metadata options
- Monitoring
- Placement-related settings
- Tenancy
- Shutdown behavior
One particularly useful option is User Data.
You can use it to run commands when an instance launches.
For example:
1
2
3
4
5
6
dnf update -y
dnf install -y nginx
systemctl enable nginx
systemctl start nginxNow the server can perform initial configuration automatically.
This is where EC2 starts becoming more than just a manually configured VM.
11. Launch the Instance
Before clicking Launch instance, review:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Region
β
AMI
β
Instance Type
β
Key Pair
β
VPC
β
Subnet
β
Public IP
β
Security Group
β
EBS
β
Advanced ConfigurationAWS's launch wizard provides a Summary panel so you can review these settings before launching. (AWS DocumentationΒ )
12. Connect to the EC2 VM
After the instance reaches the Running state, you can inspect its:
- Instance ID
- Private IPv4 address
- Public IPv4 address
- VPC
- Subnet
- Security Group
- Storage
- AMI
- Instance type
AWS provides these details directly in the EC2 console. (AWS DocumentationΒ )
For Linux, SSH is a common connection method.
The basic pattern is:
1
ssh -i my-key.pem user@public-ipThe exact username depends on the AMI.
π° Don't Forget Cost
Launching an EC2 instance also means thinking about billing.
For On-Demand EC2, compute charges apply while the instance is running, with billing generally calculated per second and a 60-second minimum for supported instances. (AWS DocumentationΒ )
For longer-term predictable workloads, Savings Plans can reduce compute costs in exchange for a usage commitment. For interruptible workloads, Spot Instances can offer substantial savings but can be interrupted when AWS needs the capacity. (AWS DocumentationΒ )
For a learning environment:
Launch β Practice β Stop when finished
And if you no longer need the VM:
Terminate it.
Also remember that stopping an instance does not necessarily eliminate all related charges, such as attached EBS storage.
π§ The Architecture Mindset
The most important lesson for me is that launching EC2 isn't about memorizing console options.
It's about asking:
Why this Region?
Why this AMI?
Why this instance type?
Why this subnet?
Does it need a public IP?
Which ports should be open?
How much storage is actually required?
How will the server be configured?
How much will it cost?
That is the difference between simply launching a VM and starting to think like a Solutions Architect.
My EC2 decision flow
Requirement β AMI β Instance Type β VPC/Subnet β Security β Storage β Configuration β Cost β Launch
That's the workflow I'm taking away from this part of my AWS learning journey. π
#AWS #AWSBuilderCenter #AWSCommunity #AmazonEC2 #EC2 #AWSCloud #SolutionsArchitect #CloudArchitecture #CloudComputing #AWSNetworking #AWSIAM #AmazonEBS #Linux #CloudLearning #LearningInPublic #AWSJourney
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article