Skip to main content

Exploring EC2 Services

Why Use EC2 Services?

Cloud services began as a way to rent computing and storage resources. Over time, providers like AWS expanded their offerings. AWS's EC2, standing for Elastic Compute Cloud, is an example of this expansion, offering Infrastructure as a Service (IaaS).

EC2 services include:

  • Renting servers (EC2)
  • Renting storage (EBS)
  • Automatically adjusting server numbers using Auto Scaling Groups (ASG)
  • Spreading workload across multiple servers (ELB)

Setting Up an EC2 Instance

When you set up an EC2 instance on AWS, there are several options to choose from. Important ones include:

  1. Operating System:
    • Linux (with choices among popular distributions)
    • Windows
    • Mac OS X
  2. CPU (core count and performance)
  3. RAM
  4. Storage Options:
    • EC2 instance storage
    • EBS & EFS
  5. Network bandwidth
  6. Firewall settings
  7. EC2 User Data Script (a startup script for the instance)

EC2 User Data Script

Bootstrapping means running commands or scripts when starting up. The EC2 User Data Script is run when the instance is first launched.

This script is for initial setup tasks like:

  • Installing software
  • Updating existing software
  • Adjusting settings in the OS or application server
  • Downloading required files

These scripts run with admin rights (sudo).

AWS has various EC2 instance types, like the t2, c5, and r5 families, each with different sizes like micro, large, xlarge, to suit different needs.

The t2.micro instance is part of AWS's free offering, allowing up to 750 hours of use per month.

Creating a New EC2 Instance

To create a new instance, follow these steps and use the User Data script for setup. Go to the EC2 services dashboard or see this AWS documentation.

EC2 services are tied to specific regions, so pick the region you want. The EC2 dashboard's main page looks like this: Ec2 dashboard