EC2 101 Flashcards

1
Q

What is EC2?

A

Elastic Compute Cloud. A service for renting virtual machines.

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

What are two ways you can pre-configure an EC2 instance?

A

1) Create an AMI from an existing EC2 instance, and use that as the base for launching new instances.
2) Add an EC2 user data script.

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

What is an AMI?

A

Amazon Machine Image

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

What are the advantages of User Data vs AMI?

A

An AMI is way faster than doing user data, and will always give you a consistent starting image to launch from.

The user data is just a script that runs every time when the image is launching. It can take several minutes to run, is more error-prone, but could be used to do dynamic configuration of an instance (especially in conjunction with instance metadata). Personally, I’d avoid using it in favor of docker or something.

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

User data vs instance metadata?

A

User data is a script that you run when launching an instance.

Instance metadata is an HTTP endpoint an instance can query as a means of reflection (to know what its configuration info is).

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

What are the four instance types?

A
  • General Purpose (t, m, a1, mac)
  • Compute Optimized (c)
  • Memory Optimized (r, x)
  • Storage Optimized (I, d, H)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What’s notable about the t-series instances?

A

The t-series is your most common, low-cost, general purpose instance. Most machines in this family are burstable, meaning that they have consumable “burst credits” that are used during short periods of higher-than-normal use.

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

What permissions does the user data script have?

A

It’s run as the root user

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

Use cases for General Purpose EC2 instance

A

Diversity of workloads like web servers or code repositories. The burstable nature of t-series are nice for web servers that have variable traffic.

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

Use cases for Compute Optimized EC2 instance

A

Back processing workloads, media transcoding, machine learning, HPC, high permance web servers, dedicated game servers

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

Use cases for Memory Optimized EC2 instance

A

High performance, relational/non-relational databases; Distributed web scale cache stores; Applications performing real-time processing of big unstructured data

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

Use cases for Storage Optimized EC2 instance

A

When you need high, sequential read/write access to large data sets on local storage. Relational/NoQL databases, Data warehousing, distributed file systems

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

What is a security group?

A

Acts as a “firewall” on EC2 instances. It defines what goes in and what goes out.

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

You try to ssh into an EC2 instance and get a timeout. What should you check first?

A

Check your security groups for the instance. You probably need to open port 22 for SSH access. As a best practice, it’s good to have a sec group that’s just for SSH access.

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

What happens if I don’t have a security group for an EC2 instance?

A

All outbound traffic is allowed, all inbound traffic is blocked.

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

You try to ssh into an EC2 instance and the connection refused. What’s the most likely explanation?

A

Your security group is allowing you in, but there’s an error within the EC2 application.

17
Q

Can a security group be attached to multiple instances?

A

Yes, it can be attached to multiple instances, but it’s locked down to a single region and VPC combination.

18
Q

What port is for FTP traffic?

A

21

19
Q

What port is for SFTP traffic?

A

22

20
Q

What port is for RDP?

A

3389 (remote desktop protocol; kinda like ssh for windows)