EC2 Fundamentals Flashcards

1
Q

What is an EC2?

A

EC2 = Elastic Compute Cloud = Infra as a service

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

What are EC2 capabilities?

A
  1. Virtual Machines (EC2)
  2. Storing data on virtual drives (EBS)
  3. Distributing load across machines (ELB)
  4. 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

What OS Can you use on an EC2?

A
  1. Linux
  2. Windows
  3. Mac OS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 7 settings you can choose on an EC2?

A
  1. OS
  2. CPU
  3. RAM
  4. Storage space
  5. Network Card (speed, public IP address)
  6. Firewall Rules (security group)
  7. Bootstrap script (configure at first launch) for EC2 user data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the 2 options of storage you can have in EC2?

A
  1. Network-attached (EBS & EFS)
  2. Hardware (EC2 Instance Store)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Bootstrapping?

A

launching commands when a machine starts (runs once at beginning)

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

What is the EC2 user data (bootstrap) used for?

A

To Automate boot tasks such as:

  1. Installing updates
  2. Installing software
  3. Downloading common files from internet
  4. Anything really
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What user does the EC2 User Data script runs with?

A

Root (has sudo rights)

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

What are the EC2 instance types?

A

t2.micro
t2xlarge

These dictate vCPU, Mem (GiB), Storage, Network, EBS bandwidth

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

Which instance type of EC2 is included in the free tier?

A

t2.micro (up to 750 hours per month)

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

What happens when you stop and start an EC2 instance?

A

The public IP might change (the private wont)

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

How many instance types of EC2 are there?

A

7

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

What are the instance types of EC2?

A
  1. General Purpose
  2. Compute optimised
  3. Memory optimised
  4. Accelerated computing
  5. Storage optimised
  6. Instance features
  7. Measuring Instance performance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does “m5.2xlarge” mean?

A

m = instance type
5 = generation
2xlarge = size within the instance class

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

What is a General Purpose EC2 instance type good for?

A

Great for diversity of workloads such as web servers or code repositories

Balance between:
1. compute
2. memory
3. networking

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

What are Compute Optimised EC2 instances good for?

A

Compute-intensive tasks that need high perf processors.

  1. batch processing workload
  2. media transcoding
  3. high perf web servers
  4. high perf computing (HPC)
  5. scientific modelling & ML
  6. dedicated gaming servers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are Memory Optimised EC2 instances good for?

A

Fast performance for workloads that process large data sets in memory

  1. High perf relational/non relational database
  2. distributed web scale cache stores
  3. in-memory databases optimised for BI (Business intelligence)
  4. apps performing real-time processing of big unstructured data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are Storage Optimised EC2 instances good for?

A

Good for storage-intensive tasks that need high sequential read/write access to large data sets on local storage

  1. High frequency online transaction processing (OLTP)
  2. Relational & NoSQL databases
  3. Cache for in-memory databases (Redis)
  4. Data warehousing apps
  5. Distributed file systems
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What do Security Groups do?

A

Control how traffic is allowed in/out of EC2 instances

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

What kind of rules do Security Groups contain?

A

Allow rules only

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

What do Security Groups rules reference by? (what do they see and say yes or no)

A

Based on IP or Security Groups

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

How is a Security Group used? Give a scenario

A

You put the SG around an EC2, and they block everything. You then set the allow list for inbound/outbound traffic.

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

Are Security Groups like a firewall?

A

Yes

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

What do Security Groups regulate?

A
  1. Access to ports
  2. Authorised IP ranges - IPv4 / IPv6
  3. Inbound traffic
  4. Outbound traffic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Does a Security Group allow all inbound traffic by default?

A

No. You set who is allowed in

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

Does a Security Group allow all outbound traffic by default?

A

Yes

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

Can Security Groups be attached to multiple instances?

A

Yes

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

Can Security Groups be in multiple regions/VPC combinations at the same time?

A

No - locked down to a region/VPC combination

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

Will the EC2 instance see the traffic that a Security Group blocks?

A

No because the SG lives outside the EC2

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

What is a good practice for SHH and Security Groups?

A

To maintain one separate SG for SSH access

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

What does it mean if your application is timing out and is not accessible?

A

Security Group issue

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

If you application gets a “connection refused” error, is it a Security Group issue?

A

No - application error or not launched.

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

How can you Reference other security groups?

A

Instead of selecting which IPs can pass through the SG, you can select Security Groups instead. For example, you have an EC2 instance with Security Group, that security group can allow all the traffic from Security Group 2 & 3 which each has another instance inside of them.

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

What is port 22?

A

SSH (Secure Shell) - log into linux instance

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

What is port 21?

A

FTP (File Transfer Protocol) - upload files into a file share

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

What port is SFTP?

A

22 just like SSH (Secure Transfer Protocol) - upload files using SSH

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

What is port 80?

A

HTTP - access unsecured websites

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

What is port 443?

A

HTTPS - access secured websites

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

When do you use SSH?

A

When you want to log into your servers via the terminal and perform maintenance/actions

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

Which OS can use SSH?

A
  1. Linux
  2. Mac
  3. Windows 10 =>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

Which OS cannot use SSH?

A

Win 10 <

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

What is an alternative if you cannot use SSH?

A

Putty

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

Which OS can use Putty?

A

Win 10 higher/lower

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

What is an EC2 instance connect?

A

Uses your web browser to connect to an EC2 instance.

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

What is the command for connecting to an EC2 instance?

A

ssh -i “keypair.pem”@<ip></ip>

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

What is the command to make the keypair private after you download it ?

A

chmod 0400 <keypair></keypair>

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

If you already have a .pem keypair and want to use Putty what can you do?

A

Convert it within Putty to a .ppk file.

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

What do you need to include in the Host Name (or IP address) filed in Putty?

A

ec2-user@<ip></ip>

ec2-user is already created in that linux instance from AWS

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

What command do you use to SSH from Win10 +?

A

ssh -i .<.pem> ec2-user@<ip></ip>

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

What is an alternative to SSH?

A

EC2 Instance Connect

51
Q

What should you never do with your AWS Access Key ID and AWS Secret Access Key while SSH’d in an EC2?

A

Do not use AWS configure which will ask you to type out that info. If the instance is not private someone else can retrieve that info from using EC2 Connect.

52
Q

What are On-Demand instances best for?

A

Short workload, predictable pricing, pay by second

53
Q

What are reserved instances? (EC2)

A

1 & 3 year options
Used for long workloads
Convertible Reserved instances - long workloads with flexible instances

54
Q

What are Savings Plans instances?

A

1 & 3 year options
commitment to an amount of usage, long workload

55
Q

What are spot instances?

A

Short workloads
Cheap
Can lose instances (less reliable)

56
Q

What are dedicated hosts instances?

A

You book an entire physical server, control instance placement

57
Q

What are Dedicated Instances?

A

only for you, no other customers will share your hardware (single tenant)

58
Q

What are Capacity Reservations instances?

A

reserve capacity in a specific AZ for any duration

59
Q

Which EC2 instance has billing per second for Windows or Linux after the first minute?

A

EC2 on Demand

60
Q

Which EC2 instance has billing per our for all OS except Win & Linux?

A

EC2 on Demand

61
Q

Which EC2 instance plan has the highest cost but no upfront payment?

A

EC2 on Demand

62
Q

Which EC2 instance plan has no long-term commitment?

A

EC2 on Demand

63
Q

What is EC2 on demand recommended for?

A

Short-term & un-interrupted workloads

64
Q

Which EC2 instance has up to 72% discount compared to on-demand?

A

Reserved Instances

65
Q

What is the reservation period for EC2 Reserved Instances?

A

1 year or 3 years (discounts)

66
Q

What are the payment options for EC2 Reserved Instances?

A

No upfront (+)
Partial upfront (++)
All upfront (+++)

67
Q

What is the EC2 reserved instances scope?

A

Regional or Zonal (reserve capacity in an AZ)

68
Q

Which EC2 instance is recommended for steady-state usage apps (databases)

A

EC2 Reserved Instances

69
Q

What can you do with EC2 Reserved Instances in AWS Marketplace?

A

Buy & Sell

70
Q

What are Convertible Reserved Instances?

A

Can change the EC2 instance type, instance family, OS, scope & tenancy

71
Q

What discount do Convertible Reserved Instances have?

A

Up to 66%

72
Q

Which EC2 instance can get a discount based on long-term usage (up to 72% - same as Reserved Instances)

A

EC2 Savings plans

73
Q

Which EC2 instance commits to a certain type of usage ($10/hour for 1 or 3 years)

A

EC2 Savings plans

74
Q

What happens to usage on an EC2 Savings Plans if it is exceeded?

A

Billed on the On-demand price

75
Q

Which EC2 instance is locked to a specific family & AWS region (e.g. M5 in us-east-l)?

A

EC2 Savings Plans

76
Q

What is EC2 Savings Plans instance flexible across?

A

Instance Size
OS type
Tenancy (Host, Dedicated, Default)

77
Q

Which EC2 Instance type has discount up to 90%?

A

Spot instance

78
Q

Which instances you can lose at any point of time if your max price is less than the current spot price?

A

Spot Instances

They are reserved to the highest bidder

79
Q

Which are the MOST cost-effective instances in AWS?

A

Spot instnaces

80
Q

Which instance is best for failure resilient workloads?

A

Spot

81
Q

Which instances are best for batch jobs

A

Spot

82
Q

Instances that are best for Data analysis

A

Spot

83
Q

Instances best for Image processing

A

Spot

84
Q

Instances best for distributed workloads

A

Spot instances

85
Q

Instances best for workloads with flexible start & end time

A

Spot

86
Q

Which instances are not suitable for critical jobs or databases?

A

Spot

87
Q

What are EC2 Dedicated Hosts?

A

Physical Server with EC2 instance capacity fully dedicated to your use

88
Q

Which EC2 instance allows you to address compliance requirements and use your existing server-bound software licenses?

A

EC2 Dedicated Hosts

89
Q

What are EC2 Dedicated Hosts Purchasing Options?

A

On-demand (per second for active Dedicated Host)
Reserved (1 or 3 years - No upfront, partial, all upfront)

90
Q

Which EC2 instance is the most expensive option?

A

EC2 Dedicated Host

91
Q

Which EC2 instance is best for software that have complicated licensing model (BYOL - Bring your own license)

A

EC2 Dedicated Hosts

92
Q

Which EC2 instance is best for companies that have strong regulatory or compliance needs?

A

EC2 Dedicated Hosts

93
Q

What are EC2 Dedicated Instances?

A

Instance that runs on hardware thats dedicated to you

94
Q

Which instance may share hardware with other instances in the same account?

A

EC2 Dedicated Instances

95
Q

Which instance has no control over instance placement (can move hardware after Stop / Start)

A

EC2 Dedicated Instances

96
Q

What is the Difference between Dedicated Hosts and Dedicated Instance?

A

Dedicated Host hardware can be shared across many instances in the same account and you get access to the physical server.

Dedicated Instance is deployed on reserved hardware for each tenant (single tenant)

97
Q

Which EC2 can Reserve On-Demand instances capacity in a specific AZ for any duration?

A

EC2 Capacity Reservations

98
Q

Which EC2 you always have access to their capacity when you need it?

A

EC2 Capacity Reservations

99
Q

Which EC2 has no time commitment? (create/cancel any time) and no billing discounts?

A

EC2 Capacity Reservations

100
Q

Which EC2 can be combined with Regional Reserved Instances and Savings Plans to benefit from billing discounts?

A

EC2 Capacity Reservations

101
Q

Which EC2 you are charged on demand rate whether you run instances or not?

A

EC2 Capacity Reservations

102
Q

What is EC2 Capacity Reservations best suited for?

A

Short-term, uninterrupted workloads that need to be in a specific AZ

103
Q

Scenario - On Demand

A

Coming and staying in a hotel whenever we like, and pay full price

104
Q

Scenario - Reserved

A

If you plan ahead to stay at the hotel for a long time you can get a good discount

105
Q

Scenario - Savings Plans

A

You pay a certain amount per hour for a certain period and stay in any room type (you can change ec2 type over time (size, os etc)

106
Q

Scenario - Spot instances

A

Bid for the empty room and highest bidder keeps the rooms. You can get kicked out at any time

107
Q

Scenario - Dedicated Hosts

A

Book the entire building of the Hotel

108
Q

Scenario - Capacity Reservations

A

Book a room for a period of time with full price even you don’t use it - just in case you need it.

109
Q

What is a Spot Request?

A

It is a request that contains the type of the request (one-time | persistent) along with other information needed to create the Spot instance. It also has information such as valid from, valid until for the request.

If its a one-time and your spot instance stops then you will need another request to recreate the spot instance. If its persistent, then the request stays alive and the instance gets created again from the same request.

110
Q

When can you ONLY cancel Spot Instance requests?

A

When the state of the spot request is: Open, Active, or Disabled

111
Q

Does a Spot instance get terminated if you cancel a spot request?

A

No - you need to terminate the instance

112
Q

What is the correct order of terminating Spot instances?

A

First the request, and then the instance

113
Q

What are Spot Fleets?

A

Set of spot instances & optional On-Demand Instances

114
Q

What does Spot fleet due when there is a target and price constraints?

A

It will try to meet target capacity with price constraints in place

115
Q

What are launch pools?

A

They are instance types, OS, Availability Zone and Spot Fleet can choose from multiple pools that you have set up

116
Q

Can Spot Fleets choose from multiple launch pools?

A

Yes they can choose from the ones you set up

117
Q

What happens to Spot Fleets when they reach capacity or max cost?

A

They stop launching instances

118
Q

What are the 3 strategies for Spot Fleets?

A

lowestPrice
diversified
capacityOptimised

119
Q

What is the lowestPrice strategy of a Spot Fleet?

A

Spot Fleet will choose instances from the pool with the lowest price (cost optimisation, short workload)

120
Q

What is the diversified strategy of a Spot Fleet?

A

Distributed across all pools (great for availability, long workloads)

121
Q

What is the capacityOptimised strategy of a Spot Fleet?

A

pool with the optimal capacity for the number of instances

122
Q

What does Spot Fleet allow us to do?

A

Automatically request spot Instances with the lowest price

123
Q

Spot Request vs Spot Fleet?

A

You create the spot request and choose what goes in the request where as Spot Fleet you create the pools, and then it chooses on its own which one is needed to do what you want at the lowest price

124
Q

What EC2 instance type should you use if you have a database on-prem, and the database has thousands of requests per second?

A

Storage Optimised EC2 because they are best for workloads which require high, sequential read/write access to large data sets on local storage