EC2
March 20, 2025
EC2 - Elastic Compute Cloud
Busy day, so not much progress, but here’s today’s summary about EC2.
What is EC2?
EC2 is one of the most popular AWS offerings.
EC2 = Elastic Compute Cloud = Infrastructure as a Service (IaaS).
It mainly consists of the capability to:
- Rent virtual machines (EC2).
- Store data on virtual drives (EBS).
- Distribute load across machines (ELB).
- Scale services using an Auto-Scaling Group (ASG).
EC2 Sizing & Configuration Options
When launching an EC2 instance, we can configure:
- Operating System (OS): Linux, Windows, or macOS.
- Compute power & cores: Number of vCPUs.
- Memory: Amount of RAM.
- Storage:
- Network-attached: EBS & EFS.
- Hardware storage: EC2 Instance Store.
- Network card: Speed, public IP address.
- Firewall rules: Managed via Security Groups.
- Bootstrap script: Configure at first launch using EC2 User Data.
EC2 User Data
It’s possible to bootstrap EC2 instances using an EC2 User Data script.
Bootstrapping means launching commands when a machine starts.
- The script runs only once, at the instance's first start.
- EC2 User Data is used to automate boot tasks such as:
- Installing updates.
- Installing software.
- Downloading common files from the internet.
- Any other initialization task.
- The script runs as root by default.