EC2 - Basics Flashcards

1
Q

What is Amazon EC2?

A
  • EC2 is one of the most popular AWS products
  • EC2 = Elastic Compute Cloud = Infrastructure as a Service
  • It mainly consists in the capability of:
    • Renting virtual machines (EC2)
    • Storing data on virtual drives (EBS)
    • Distributing load across machines (ELB)
    • Scaling the services using an auto-scaling group (ASG)
  • Cost and Capacity Optimization - Pay for What You Use
  • Knowing EC2 is fundamental to understand how the Cloud works
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are EC2 sizing & configuration options?

A

Configuration how you want your EC2 Virtual instances to be:
* Operating System (OS): Linux, Windows or Mac OS
* How much compute power & cores (CPU)
* How much random-access memory (RAM)
* How much storage space:
* Network-attached (EBS & EFS)
* hardware (EC2 Instance Store - block-level storage physically attached to the host computer)
* Network card: speed of the card, Public IP address
* Firewall rules security group
* Bootstrap script (configure at first launch): EC2 User Data

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

What is EC2 User Data?

A
  • It is possible to bootstrap our instances using an EC2 User Data script
  • Bootstrapping means launching commands when a machine starts
  • That script is only run once when the instance starts
  • EC2 User Data is used to automate boot tasks such as:
    • Install updates
    • Installing software
    • Downloading common files from the internet
    • Anything you can think of
  • The EC2 User Data Script runs with the root user
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you launch a EC2 Instance?

A
  1. Go to EC2 Dashboard
  2. Click on Launch Instance
  3. Enter instance name
  4. Select the OS Image
    • Amazon Linux
    • macOS
    • Ubuntu
    • Windows
    • Red Hat
    • SUSE Linux
    • Debian
  5. Select the OS machine image type
  6. Select the machine architecture 64-bit (x86) or 64-bit(ARM)
  7. Select instance type - t2.macro
  8. Create SSH Key Pair to login to your EC2 Instance
  9. Network section will create a VPC with an auto assign public IP
  10. A default Security Group (firewall) will be automatically created called launch-wizard-1 with the following rules:
    • Allow SSH traffic from Anywhere 0.0.0.0/0
    • Allow HTTPs traffic from the internet
    • Allow HTTP traffic from the internet
  11. Configure Storage - free tier can get up to 30 GB of EBS storage
    • Advanced option: Delete on termination is default to Yes meaning if we terminate our EC2 instance the storage volume will be deleted
  12. Advnace Details:
    • Domain Active Directory (AD) creation
    • IAM instance profile
    • Hostname and DNS
    • Instance behavior settings
    • Metadata
    • User Data
  13. Launch instance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the methods to connect to your EC2 instance?

A
  • SSH (OpenSSH - Mac, Linux, Windows > 10)
  • Putty (Windows < 10)
  • EC2 Instance Connect (web browser)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the available AWS SSH Keys and formats?

A

Two type of SSH Keys:
1. RSA encryption
2. ED25519 encryption (not supported for Windows instances)

Two types of key file format:
1. .pem - use with OpenSSH (macOS, Linux, Windows 10+)
2. .ppk - use with PuTTY (Windows < 10)

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

How do you create and connect to EC2 with SSH?

A
  • Go to EC2 Dashboard > Key Pairs
  • Click Create key pair to create a new key pair
  • Download the .pem (OpenSSH) or .ppk (PuTTy)
  • Open SSH client with command prompt
  • Enter ssh -i "./EC2_Instance_SSH_Keys.pem" ec2-34-228-11-197.compute-1.amazonaws.com

Note: If you’re getting WARNING: UNPROTECTED PRIVATE KEY FILE! - remove all other user’s access to your SSH file

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

What is the EC2 Instance Type naming convention?

A

AWS has the following naming convention:

  • 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
9
Q

What are the EC2 Instance types?

A

Instance vCPU Mem (GiB) Storage Network Perf EBS Bandwidth (Mbps)
1. t2.micro 1 1 EBS-Only Low to Moderate
2. t2.xlarge 4 16 EBS-Only Moderate
3. c5d.4xlarge 16 32 1 x 400 NVMe SSD Up to 10 Gbps 4,750
4. m5.8xlarge 32 128 EBS-Only 10 Gbps 6,800
5. r5.16xlarge 64 512 EBS-Only 20 Gbps 13,600

t2.micro is part of the AWS free tier (up to 750 hours per month)

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

How are EC2 optimized for different use case?

A
  • Different types of EC2 instances optimized for different use cases:
    • General Purpose
    • Compute Optimized
    • Memory Optimized
    • Accellerated Computing
    • Storage Optimized
    • HPC Optimized
    • Instance Features
    • Measuring Instance Performance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly