EC2 Fundamentals Flashcards

1
Q

What is EC2?

A
  • Elastic Cloud Compute (EC2) -> Infrastructure as a Service
  • Renting of virtual machines
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What sizing & configurations options does EC2 offer?

A
  • 💻 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)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is EC2 User Data?

A

bootstrap script run only once at the instance first start

runs with the root user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are common boot tasks automated in EC2 User Data?

A
  • installing updates
  • installing software
  • downloading common files from the internet

…or anything else you want

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What optimized EC2 Instance Types does AWS offer?

A
  • General Purpose
  • Compute Opmtimized
  • Memory Optimized
  • Storage Optimized
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the EC2 instance type naming convention?

i.e. m5.2xlarge

A

m5.2xlarge

m: instance class
5: generation (AWS improves them over time)
2xlarge: size within the instance class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When is it ideal to use a General Purpose EC2 Instance?

A
  • diversity of workloads (i.e. web servers or code repos)
  • resources balanced between: compute, memory, & networking

i.e. t2.micro

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When is it ideal to use a Compute Optimized EC2 Instance?

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When is it ideal to use a Memory Optimized EC2 Instance?

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

When is it ideal to use a Storage Optimized EC2 Instance?

A

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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are Security Groups?

A
  • 🚨 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What do Security Groups regulate?

A
  • Access to Ports
  • Authorised IP ranges (IPv4 & IPv6)
  • ➡⏹️ Control of inbound network (from other to instance)
  • ⬅⏹️Control of outbound network (from instance to other)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the Security Group traffic default settings?

A
  • all inbound traffic is blocked by default
  • all outbound traffic is authorised by default
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are some troubleshooting tips for 2 common EC2 connection errors?

A

Error 1: Timeout - application not accessible
Cause: Security group issue

Error 2: Connection refused
Cause: application error OR EC2 not launched

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are some Security Group “good to know” facts?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What port allows SSH traffic to reach your EC2 instance?

SSH (Secure Shell)

A

22 = SSH
Protocol Use: Log into a linux instance

17
Q

What port allows FTP traffic to reach your EC2 instance?

FTP (File Transfer Protocol)

A

21 = FTP
Protocol Use: upload files into a file share

18
Q

What port allows HTTP traffic to reach your EC2 instance?

A

80 = HTTP
Protocol Use: access unsecured websites

19
Q

What port allows HTTPS traffic to reach your EC2 instance?

A

443 = HTTPS
Protocol Use: access secured websites

20
Q

What port allows RDP traffic to reach your EC2 instance?

RDP (Remote Desktop Protocol)

A

3389 = RDP
Protocol Use: log into a Windows instance

21
Q

What port allows HTTPS traffic to reach your EC2 instance?

A

443 = HTTPS
Protocol Use: access secured websites

22
Q

What is SSH?

A

SSH (Secure Shell) allows you to connect to and control a remote machine from the command line using key pairs

SSH Options:
* SSH - Mac, Linux, Windows 10>=
* Putty - Windows
* EC2 Instance Connect - Everything!

23
Q

What EC2 Instances Purchasing Options are available?

A
  • On-Demand: short workload, predictable pricing, pay by second
  • Reserved (1 & 3 years): long workloads
  • Savings Plans (1 & 3 years): commitment to an amount of usage, long workload
  • Spot Instances: short workloads, cheap, less reliable (can lose instances
  • Dedicated Hosts: book an entire physical server, control instance placement
  • Dedicated Instance: no other customers will share your hardware
  • Capacity Reservation: reserve capcity in a specific AZ for any duration
24
Q

When is EC2 On Demand pricing recommended?

A

short-term & un-interrupted workloads; can’t predict how app will behave
* $$$ pay as you go
* no long-term commitment

25
Q

When is EC2 Reserved or Covertible Reserved Pricing recommended?

A

long-term, steady-state usage applications (i.e. database)
* $$ ~70% discount compared to On-demand
* 1 or 3 year comittment
* Convertible Reserved - flexible to change type, family, etc.

26
Q

When is Spot EC2 Spot Instances pricing recommended?

A

non critical workloads that are resilient to failure
* $ ~90% discount compared ton On-demand; MOST cost-efficient instance in AWS!

Use cases:
* Batch jobs
* Data analysis
* Image processing
* Distrubted workloads
* Workloads with a flexible start & end time

⛔️ NOT suiteable for critical jobs or databases

27
Q

When is EC2 Dedicated Host pricing recommended?

A

software with **complicated licensing model **or companies with **strong regulatory **or compliance needs
* $$$$ most expensive
* dedicated physical server to with access to lower-level hardware

28
Q

When is EC2 Capacity Reservation pricing recommended?

A

short-term, uninterrupted workloads that need to be in a specific AZ
* $$$ On-demand instance capacity in specific AZ for any duration
* Charged On-demand rate where you run instances or not

29
Q

When is EC2 Savings Plan pricing recommended?

A

long-term workloads, flexible across certain usage types
* $$ ~70% discount compared to On-demand
* 1 or 3 year commitment
* locked to instance family & region

30
Q

How do you terminate a Spot Instance?

A
  1. Cancel a Spot Request (must be in an Open, Active, or Disabled state)
  2. Terminate associated Spot Instance

Cancelling a Spot Request does NOT terminate instances

31
Q

What is a Spot Fleet?

A

spot fleet = set of Spot Instances + (optional) On-Demand Instances
* try to meet target capacity with price constraints

Spot Fleet Strategies
* lowestPrice - cost opmtimization, short workload
* priceCapcityOptimized (recommended)

✨ TIP: Spot Fleets allow us to automatically request Spot Instances with lowest price