EC2 Fundamentals Flashcards
What is EC2?
- Elastic Cloud Compute (EC2) -> Infrastructure as a Service
- Renting of virtual machines
What sizing & configurations options does EC2 offer?
- 💻 Operating System (OS): Linux, Windows, or Mac OS
- 💪🏻 CPU: Compute power & cores
- 🧠 RAM: random-access memory
- 🗄️ Storage Space: network-attached (EBS & EFS); hardware (EC2 Instance Store)
- 🕸️ Network card: speed of the card, Public IP
- 🚨 Security group: firewall rules
- 🥾 EC2 User Data: bootstrap script (configure at first launch)
What is EC2 User Data?
bootstrap script run only once at the instance first start
runs with the root user
What are common boot tasks automated in EC2 User Data?
- installing updates
- installing software
- downloading common files from the internet
…or anything else you want
What optimized EC2 Instance Types does AWS offer?
- General Purpose
- Compute Opmtimized
- Memory Optimized
- Storage Optimized
What is the EC2 instance type naming convention?
i.e. m5.2xlarge
m5.2xlarge
m: instance class
5: generation (AWS improves them over time)
2xlarge: size within the instance class
When is it ideal to use a General Purpose EC2 Instance?
- diversity of workloads (i.e. web servers or code repos)
- resources balanced between: compute, memory, & networking
i.e. t2.micro
When is it ideal to use a Compute Optimized EC2 Instance?
compute-intensive tasks that require high performance processors
Use Cases
- Batch processing workloads
- Media transcoding
- High performance web servers
- High performance computing (HPC)
- Scientific modeling & machine learning
- Dedicated gaming servers
When is it ideal to use a Memory Optimized EC2 Instance?
fast performance for worklaods that process large data sets in memory
Use Cases
- High performance, relational/non-relational databases
- distributed web scale cache stores
- In-memory databases optimized for BI (business intelligence)
- Applications performing real-time processing of big unstructured data
When is it ideal to use a Storage Optimized EC2 Instance?
storage-intensive tasks that require high, sequential read & write acess to large data sets on local storage
Use Cases
- High frequency online transaction proccessing (OLTP) systems
- Relational & NoSQL databases
- Cache for in-memory databases (i.e. Redis)
- Data warehousing applications
- Distributed file systems
What are Security Groups?
- 🚨 network security in AWS; act as a “firewall”
- ↔️ control how traffic is allowed into (inbound) or out of (outbound) of EC2 Instances
- ✅ contain only ALLOW rules
- reference by IP or by security group
What do Security Groups regulate?
- Access to Ports
- Authorised IP ranges (IPv4 & IPv6)
- ➡⏹️ Control of inbound network (from other to instance)
- ⬅⏹️Control of outbound network (from instance to other)
What are the Security Group traffic default settings?
- all inbound traffic is blocked by default
- all outbound traffic is authorised by default
What are some troubleshooting tips for 2 common EC2 connection errors?
Error 1: Timeout - application not accessible
Cause: Security group issue
—
Error 2: Connection refused
Cause: application error OR EC2 not launched
What are some Security Group “good to know” facts?
Security groups…
* can be attached to multiple instances
* Locked down to a region/VPC combo
* lives “outside” the EC2 - if traffic is blocked, EC2 won’t see it
💡 Best Practice: maintain one separate security group for SSH access