EC2 Flashcards

1
Q

What is EC2?

A

EC2 = Elastic Cloud Computing = Infrastructure as Service

One of the most popular AWS’s services

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

What does EC2 capability consist of?
/ What are you able to do with EC2?

(4 points)

A

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

EC2 Sizing and Configuration Options

- What can we choose for our instances?

A

EC2 sizing & configuration options. We can choose:
• Operating System (OS): Linux or Windows
• How much compute power & cores (CPU)
• How much random-access memory (RAM)

  • How much storage space:
  • Network-attached (EBS & EFS)
  • or hardware-attached (EC2 Instance Store)
  • 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
4
Q

What type of instances do we get for EC2?

A

Instance vCPU Mem (GiB) Storage Network Performance EBS Bandwidth (Mbps)

t2. micro 1 1 EBS-Only Low to Moderate
t2. xlarge 4 16 EBS-Only Moderate
c5d. 4xlarge 16 32 1 x 400 NVMe SSD Up to 10 Gbps 4,750
r5. 16xlarge 64 512 EBS Only 20 Gbps 13,600
m5. 8xlarge 32 128 EBS Only 10 Gbps 6,800

** 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
5
Q

What is AMI?

A

AMI = Amazon Machine Image

AMI is a template that contains the software configuration (operating system, application server, and applications) required to launch your instance.

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

How can you select/get an AMI?

3 points

A

You can create your own AMI’s
You can buy AMIs from AWS Marketplace
Get AMI from the Community

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

Define Security Groups

What are they?

A
  • Security Groups are the fundamental of network security in AWS
  • They control how traffic is allowed into or out of our EC2 Instances.
  • Security groups only contain ALLOW rules
  • Security groups rules can reference by IP or by security group
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the purpose of Security Groups?

5 points

A

• Security groups are acting as a “firewall” on EC2 instances
- They regulate:
• Access to Ports
• Authorised IP ranges – IPv4 and IPv6
• Control of inbound network (from other to the instance)
• Control of outbound network (from the instance to other)

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

Name the Classic Ports (6 in total)

A
  • 22 = SSH (Secure Shell) - log into a Linux instance
  • 21 = FTP (FileTransport Protocol) – upload files into a file share
  • 22 = SFTP (Secure FileTransport Protocol) – upload files using SSH
  • 80 = HTTP – access unsecured websites
  • 443 = HTTPS – access secured websites
  • 3389 = RDP (Remote Desktop Protocol) – log into a Windows instance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

EC2 instant connect

A

Uses your web browser to connect to your EC2 instance
Valid for Mac, Windows and Linux (all versions)
Works with Amazon NX2

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

puTTy

A

PuTTY allows you to use the SSH protocol to connect into your EC2 instances.

PuTTY is a free implementation of SSH and Telnet for Windows and Unix platforms, along with an xterm terminal emulator.

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

SSH

A
  • Port 22

SSH is one of the most important function. It allows you to control a remote machine, all using the command line.

Mac/Linux Users:
We will see how we can configure OpenSSH ~/.ssh/config to facilitate the SSH into our EC2 instances

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

How to connect computer over the web to your EC2 instance

Mac User

A

ssh - key - IP

In terminal:
ssh -i ‘reference the key fil (.pem) ec2-user@ ‘add IPv4 address here’

if you have a permission denied
in terminal - chmod 0400 “reference the key file”

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

SSH Troubleshooting

A

1 - There’s a connection timeout

This is a security group issue. Any timeout (not just SSH) is related to security groups or a firewall. Ensure it is correctly assigned to your EC2 instance.

2 - Still a timeout issue

A corporate firewall or a personal firewall is blocking the connection. Please use EC2 instance Connect

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

EC2 Instance Connect

A

Browser based SSH Connection

  • Note: EC2 Instance Connect may only work with Amazon Linux 2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

EC2 Instances Purchasing Options

5 Options

A
  • On-Demand Instances: short workload, predictable pricing
  • Reserved: (MINIMUM 1 year commitment)
  • Reserved Instances: long workloads
  • Convertible Reserved Instances: long workloads with flexible instances (change their types over time)
  • Scheduled Reserved Instances: example – every Thursday between 3 and 6 pm
  • Spot Instances: short workloads, cheap, can lose instances (less reliable)
  • Dedicated Hosts: book an entire physical server, control instance placement • Dedicated Instances: no other customers will share your hardware
17
Q

EC2 On Demand

6 points

A
  • Pay for what you use:
  • Linux - billing per second, after the first minute
  • All other operating systems (ex:Windows) - billing per hour
  • Has the highest cost but no upfront payment
  • No long-term commitment
  • Recommended for short-term and un-interrupted workloads, where you can’t predict how the application will behave
18
Q

EC2 Reserved Instances

A
  • Up to 72% discount compared to On-demand
  • Reservation period: 1 year = + discount | 3 years = +++ discount
  • Purchasing options: no upfront | partial upfront = + | All upfront = ++ discount • Reserve a specific instance type
  • Recommended for steady-state usage applications (think database)
  • Convertible Reserved Instance
  • can change the EC2 instance type • Up to 45% discount
  • Scheduled Reserved Instances
  • launch within time window you reserve
  • When you require a fraction of day / week / month • Commitment for 1 year only
19
Q

EC2 Spot Instances

4 points

A
  • Can get a discount of up to 90% compared to On-demand
  • Instances that you can “lose” at any point of time if your max price is less than the current spot price
  • The MOST cost-efficient instances in AWS
  • Useful for workloads that are resilient to failure
  • Batch jobs
  • Data analysis
  • Image processing
  • Any distributed workloads
  • Workloads with a flexible start and end time
  • Not suitable for critical jobs or databases
20
Q

EC2 Dedicated Hosts

5 points

A
  • An Amazon EC2 Dedicated Host is a physical server with EC2 instance capacity fully dedicated to your use. Dedicated Hosts can help you address compliance requirements and reduce costs by allowing you to use your existing server-bound software licenses.
  • Allocated for your account for a 3-year period reservation
  • More expensive
  • Useful for software that have complicated licensing model (BYOL – Bring Your Own License)
  • Or for companies that have strong regulatory or compliance needs
21
Q

EC2 Dedicated Instances

3 points

A
  • Instances running on hardware that’s dedicated to you
  • May share hardware with other instances in same account
  • No control over instance placement (can move hardware after Stop / Start)
22
Q

Shared Responsibility Model For EC2

What is AWS Responsible for?

A

AWS is responsible for all data centers, their infrastructure and security of them.

  • Infrastructure (global network security)
  • Isolation on physical hosts
  • Replacing faulty hardware
  • Compliance validation
23
Q

Shared Responsibility Model For EC2

What is the USER Responsible for?

A

The USER is responsible for the security in the cloud.

You define your own security group rules and this allows you or other people to access your EC2 instances

You own the entire virtual machine inside of your EC2 instance
All the patches and updates you have to do them
All the software and utilities that are installed on the EC2 instance are your responsibility.

  • IAM Roles assigned to EC2 & IAM user access management
  • Data security on your instance