Back to posts

AWS Journey: First Steps with EC2

Feb 11, 2025โ€ข5 min read

After years of working with Go, SQL, Docker containers, and CI/CD, I've decided to expand my knowledge of cloud computing. My goal is to deepen my expertise in AWS, with a plan to earn the AWS Developer Certification along the way. I'm starting with EC2 fundamentals to build a strong foundation, and I'm excited to share this learning journey with you!

Funny story: I had no idea what SSH meant in my first job. I simply followed instructions to connect to servers without fully understanding how it worked. Not only that, but I also had limited knowledge of Linux commandsโ€”I just relied on others to get the job done. Fast forward to now, and I've gained much deeper insight into securing and managing instances with tools like SSH and Linux commands.

๐Ÿ“ Step-by-Step Guide

1. Instance Creation

Let's start by creating our EC2 instance with Amazon Linux 2023.

EC2 instance creation showing name and OS selection Setting instance name and choosing Amazon Linux 2023

2. Instance Type Selection

For our initial setup, we'll use t2.micro, which is Free Tier eligible.

Instance type selection showing t2.micro Starting with t2.micro (Free Tier eligible)
  • We'll upgrade to t2.small later for better performance when running Docker containers.

3. SSH Key Pair Setup

Set ssh key pair Setting up SSH key pair
  • Use .pem for SSH (OpenSSH)
  • Use .pem for PuTTY (requires conversion to .ppk)
  • Use .ppk directly with PuTTY
  • Convert between formats as needed using PuTTYgen

4. Storage Configuration

While the default is 8GB, we'll configure 16GB for our development needs.

Storage configuration showing 16GB gp3 storage Setting up 16GB gp3 storage
  • Increased from default 8 GB to 16 GB
  • Remains Free Tier eligible (up to 30 GB)
  • Additional space allocated for Docker images

5. Security Group Configuration

Security Groups act as a firewall to control inbound and outbound traffic.

Security group configuration showing inbound and outbound rules Setting up security group rules
  • Restrict SSH access to your IP address only (avoid using 0.0.0.0/0)
  • Enable HTTP/HTTPS for web application access
  • Limit port exposure to trusted sources only

6. Launch Review

Always verify your configuration before launching.

Launch review showing instance details Final review before launch

7. Instance Status

After launch, verify that your instance is running correctly.

Instance running showing status and IP address Instance successfully launched and running

8. Elastic IP Setup

To maintain a static IP address, we'll allocate and associate an Elastic IP.

Elastic IP setup showing allocation Allocating Elastic IP
Elastic IP setup showing association Associating Elastic IP
Elastic IP setup showing instance details with elastic ip Instance details showing Elastic IP

โš ๏ธ Common Pitfalls

  • Never expose SSH (port 22) to all IPs (0.0.0.0/0)
  • Always restrict access to your specific IP
  • Regularly review and update security group rules

๐Ÿ“ฆ Resource Management

  • Start with t2.micro (Free Tier) and upgrade as needed
  • Plan storage capacity in advance (16GB recommended)
  • Monitor Elastic IP costs when not attached to running instances

๐ŸŒŸ Learning Journey Highlights

โœ… AWS Foundations

  • AWS Console navigation
  • Basic AWS CLI commands
  • AWS region understanding
  • Free Tier limitations

โœ… Instance Management

  • t2.micro configuration (Free Tier eligible)
  • SSH key pair management
  • Storage expansion (8GB to 16GB)

โœ… Network Configuration

  • Security group setup
  • Inbound/outbound rule configuration
  • Elastic IP management

๐Ÿ“ˆ Next Steps: Development Environment

Our upcoming focus areas include:

  • Upgrading to t2.small for improved performance
  • Installing development tools (Docker, Docker Compose, GitLab Runner)
  • Configuring deployment environment