Skip to content

Commit 899c510

Browse files
author
abregman
committed
Add a couple of AWS questions and exercises
EBS & ELB mainly.
1 parent c93d394 commit 899c510

9 files changed

+316
-31
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
:busts_in_silhouette:  Join our [DevOps community](https://www.facebook.com/groups/538897960007080) where we have discussions and share resources on DevOps
1212

13-
:pencil:  You can add more questions and exercises by submitting pull requests :) Read about contribution guidelines [here](CONTRIBUTING.md)
13+
:pencil:  You can add more exercises by submitting pull requests :) Read about contribution guidelines [here](CONTRIBUTING.md)
1414

1515
****
1616

@@ -7605,7 +7605,7 @@ A load balancer accepts (or denies) incoming network traffic from a client, and
76057605
</b></details>
76067606

76077607
<details>
7608-
<summary>What benefits load balancers provide?</summary><br><b>
7608+
<summary>Why to used a load balancer?</summary><br><b>
76097609

76107610
* Scalability - using a load balancer, you can possibly add more servers in the backend to handle more requests/traffic from the clients, as opposed to using one server.
76117611
* Redundancy - if one server in the backend dies, the load balancer will keep forwarding the traffic/requests to the second server so users won't even notice one of the servers in the backend is down.
@@ -8276,14 +8276,20 @@ With vertical scaling alone, the component still remains a single point of failu
82768276
In addition, it has hardware limit where if you don't have more resources, you might not be able to scale vertically.
82778277
</b></details>
82788278

8279+
<details>
8280+
<summary>Which type of cloud services usually support vertical scaling?</summary><br><b>
8281+
8282+
Databases, cache. It's common mostly for non-distributed systems.
8283+
</b></details>
8284+
82798285
<details>
82808286
<summary>Explain Horizontal Scaling</summary><br><b>
82818287

82828288
Horizontal Scaling is the process of adding more resources that will be able handle requests as one unit
82838289
</b></details>
82848290

82858291
<details>
8286-
<summary>What is the disadvange of Horizontal Scaling? What is often required in order to perform Horizontal Scaling?</summary><br><b>
8292+
<summary>What is the disadvantage of Horizontal Scaling? What is often required in order to perform Horizontal Scaling?</summary><br><b>
82878293

82888294
A load balancer. You can add more resources, but if you would like them to be part of the process, you have to serve them the requests/responses.
82898295
Also, data inconsistency is a concern with horizontal scaling.

exercises/aws/README.md

Lines changed: 161 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ Note: Provided solutions are using the AWS console. It's recommended you'll use
2929
| Volume Creation | EC2, EBS | [Exercise](ebs_volume_creation.md) | [Solution](solutions/ebs_volume_creation.md) | Easy |
3030
| Snapshots | EC2, EBS | [Exercise](snapshots.md) | [Solution](solutions/snapshots.md) | Easy |
3131
| Create an AMI | EC2, AMI | [Exercise](create_ami.md) | [Solution](solutions/create_ami.md) | Easy |
32+
| Create EFS | EC2, EFS | [Exercise](create_efs.md) | [Solution](solutions/create_efs.md) | Easy |
33+
34+
#### AWS - ELB
35+
36+
|Name|Topic|Objective & Instructions|Solution|Comments|
37+
|--------|--------|------|----|----|
38+
| Application Load Balancer | ELB, ALB | [Exercise](app_load_balancer.md) | [Solution](solutions/app_load_balancer.md) | Easy |
39+
| Multiple Target Groups | ELB, ALB | [Exercise](alb_multiple_target_groups.md) | [Solution](solutions/alb_multiple_target_groups.md) | Easy |
3240

3341
#### AWS - Lambda
3442

@@ -341,10 +349,10 @@ Storage Optimized:
341349
EBS
342350
</b></details>
343351

344-
##### AWS EC2 - Storage
352+
##### AWS EC2 - EBS
345353

346354
<details>
347-
<summary>Explain what is Amazon EBS</summary><br><b>
355+
<summary>Explain Amazon EBS</summary><br><b>
348356

349357
[AWS Docs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html): "provides block level storage volumes for use with EC2 instances. EBS volumes behave like raw, unformatted block devices."
350358
</b></details>
@@ -393,12 +401,6 @@ Yes, with multi-attach it's possible to attach a single EBS volume to multiple i
393401
True
394402
</b></details>
395403

396-
<details>
397-
<summary>How to move EBS volumes between availability zones?</summary><br><b>
398-
399-
Using snapshots.
400-
</b></details>
401-
402404
<details>
403405
<summary>What EBS volume types are there?</summary><br><b>
404406

@@ -438,6 +440,14 @@ HDD - sc1
438440
SSD: gp2, gp3, io1, io2
439441
</b></details>
440442

443+
<details>
444+
<summary>True or False? In EBS gp2 volume type, IP will increase if the disk size increases</summary><br><b>
445+
446+
True.
447+
</b></details>
448+
449+
##### AWS EC2 - Instance Store
450+
441451
<details>
442452
<summary>If you would like to have an hardware disk attached to your EC2 instead of a network one (EBS). What would you use?</summary><br><b>
443453

@@ -494,15 +504,33 @@ False. EFS scales automatically and you pay-per-use.
494504
</b></details>
495505

496506
<details>
497-
<summary>Which EFS mode would you use if need maximum throughput?</summary><br><b>
507+
<summary>What EFS modes are there?</summary><br><b>
498508

499-
Performance Mode (Max I/O): This provides high throughput and it's used for big data, media processing, etc.
509+
* Performance mode
510+
* General purpose: used mainly for CMS, web serving, ... as it's optimal for latency sensitive applications
511+
* Max I/O: great for scaling to high levels of throughput and I/O operations per second
512+
* Throughput mode
513+
* Bursting: scale throughput based on FS size
514+
* Provisioned: fixed throughput
515+
</b></details>
516+
517+
<details>
518+
<summary>Which EFS mode would you use if you need to perform media processing?</summary><br><b>
519+
520+
Performance Mode (Max I/O): It provides high throughput and scales to operations per second. Mainly used for big data, media processing, etc.
500521
</b></details>
501522

502523
<details>
503524
<summary>What is the default EFS mode?</summary><br><b>
504525

505-
Performance Mode (General Purpose): Used for web servers, CMS, etc.
526+
Performance Mode (General Purpose): Used for web serving, CMS, ... anything that is sensitive to latency.
527+
</b></details>
528+
529+
<details>
530+
<summary>What EFS storage tiers are there?</summary><br><b>
531+
532+
* Standard: frequently accessed files
533+
* Infrequent access: lower prices to store files but it also costs to retrieve them
506534
</b></details>
507535

508536
##### AWS EC2 - Pricing Models
@@ -825,7 +853,7 @@ Amazon definition: "AWS Fargate is a serverless compute engine for containers th
825853
Learn more [here](https://aws.amazon.com/fargate)
826854
</b></details>
827855

828-
#### AWS Storage
856+
#### AWS - S3
829857

830858
<details>
831859
<summary>Explain what is AWS S3?</summary><br><b>
@@ -910,7 +938,6 @@ Storage classes offered today:
910938
* have 9x9% durability
911939

912940
More on storage classes [here](https://aws.amazon.com/s3/storage-classes)
913-
914941
</b></details>
915942

916943
<details>
@@ -988,14 +1015,6 @@ Learn more [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-accel
9881015
<summary>What storage options are there for EC2 Instances?</summary><br><b>
9891016
</b></details>
9901017

991-
<details>
992-
<summary>What is AWS Snowmobile?</summary><br><b>
993-
994-
"AWS Snowmobile is an Exabyte-scale data transfer service used to move extremely large amounts of data to AWS."
995-
996-
Learn more [here](https://aws.amazon.com/snowmobile)
997-
</b></details>
998-
9991018
#### AWS Disaster Recovery
10001019

10011020
<details>
@@ -1056,23 +1075,92 @@ True
10561075
A transport solution which was designed for transferring large amounts of data (petabyte-scale) into and out the AWS cloud.
10571076
</b></details>
10581077

1059-
##### AWS ELB
1078+
#### AWS - ELB
10601079

10611080
<details>
10621081
<summary>What is ELB (Elastic Load Balancing)?</summary><br><b>
10631082

1064-
AWS definition: "Elastic Load Balancing automatically distributes incoming application traffic across multiple targets, such as Amazon EC2 instances, containers, IP addresses, and Lambda functions."
1083+
[AWS Docs](https://aws.amazon.com/elasticloadbalancing): "Elastic Load Balancing automatically distributes incoming application traffic across multiple targets, such as Amazon EC2 instances, containers, IP addresses, and Lambda functions."
1084+
</b></details>
1085+
1086+
<details>
1087+
<summary>True or False? Elastic Load Balancer is a managed resource (= AWS takes care of it)</summary><br><b>
1088+
1089+
True. AWS responsible for making sure ELB is operational and takes care of lifecycle operations like upgrades, maintenance and high availability.
1090+
</b></details>
1091+
1092+
<details>
1093+
<summary>What types of AWS load balancers are there?</summary><br><b>
1094+
1095+
* Classic Load Balancer (CLB): Mainly for TCP (layer 4) and HTTP, HTTPS (layer 7)
1096+
* Application Load Balancer (ALB): Mainly for HTTP, HTTPS and WebSocket
1097+
* Network Load Balancer (NLB): Mainly for TCP, TLS and UDP
1098+
* Gateway Load Balancer (GWLB): Mainly for layer 3 operations (IP protocol)
1099+
</b></details>
1100+
1101+
<details>
1102+
<summary>Which load balancer would you use for services which use HTTP or HTTPS traffic?</summary><br><b>
10651103

1066-
More on ELB [here](https://aws.amazon.com/elasticloadbalancing)
1104+
Application Load Balancer (ALB).
1105+
</b></details>
1106+
1107+
<details>
1108+
<summary>True or False? With ALB (Application Load Balancer) it's possible to do routing based on query string and/or headers</summary><br><b>
1109+
1110+
True.
1111+
</b></details>
1112+
1113+
<details>
1114+
<summary>Explain "health checks" in the context of AWS ELB</summary><br><b>
1115+
1116+
Health checks used by ELB to check whether EC2 instance(s) are properly working.<br>
1117+
If health checks fail, ELB knows to not forward traffic to that specific EC2 instance where the health checks failed.
1118+
</b></details>
1119+
1120+
<details>
1121+
<summary>True or False? AWS ELB health checks are done on a port and a route</summary><br><b>
1122+
1123+
True.
1124+
1125+
For example, port `2017` and endpoint `/health`.
10671126
</b></details>
10681127

10691128
<details>
10701129
<summary>What types of load balancers are supported in EC2 and what are they used for?</summary><br><b>
10711130

1072-
* Application LB - layer 7 traffic
1073-
* Network LB - ultra-high performances or static IP address (layer 4)
1074-
* Classic LB - low costs, good for test or dev environments (retired by August 15, 2022)
1075-
* Gateway LB - transparent network gateway and and distributes traffic such as firewalls, intrusion detection and prevention systems, and deep packet inspection systems. (layer 3)
1131+
* Application LB - layer 7 traffic<br>
1132+
* Network LB - ultra-high performances or static IP address (layer 4)<br>
1133+
* Classic LB - low costs, good for test or dev environments (retired by August 15, 2022)<br>
1134+
* Gateway LB - transparent network gateway and and distributes traffic such as firewalls, intrusion detection and prevention systems, and deep packet inspection systems. (layer 3)<br>
1135+
</b></details>
1136+
1137+
<details>
1138+
<summary>Which type of AWS load balancer is used in the following drawing?<br>
1139+
<img src="images/aws/identify_load_balancer.png" width="300x;" height="400px;"/>
1140+
</summary><br><b>
1141+
1142+
Application Load Balancer (routing based on different endpoints + HTTP is used).
1143+
</b></details>
1144+
1145+
<details>
1146+
<summary>What are possible target groups for ALB (Application Load Balancer)?</summary><br><b>
1147+
1148+
* EC2 tasks
1149+
* ECS instances
1150+
* Lambda functions
1151+
* IP Addresses
1152+
</b></details>
1153+
1154+
<details>
1155+
<summary>True or False? ALB can route only to a single route group</summary><br><b>
1156+
1157+
False. ALB can route to multiple target groups.
1158+
</b></details>
1159+
1160+
<details>
1161+
<summary>True or False? Network load balancers operate in layer 4</summary><br><b>
1162+
1163+
True. They forward TCP, UDP traffic.
10761164
</b></details>
10771165

10781166
#### AWS Security
@@ -1915,6 +2003,14 @@ Amazon definition: "AWS OpsWorks is a configuration management service that prov
19152003
Learn more about it [here](https://aws.amazon.com/opsworks)
19162004
</b></details>
19172005

2006+
<details>
2007+
<summary>What is AWS Snowmobile?</summary><br><b>
2008+
2009+
"AWS Snowmobile is an Exabyte-scale data transfer service used to move extremely large amounts of data to AWS."
2010+
2011+
Learn more [here](https://aws.amazon.com/snowmobile)
2012+
</b></details>
2013+
19182014
<details>
19192015
<summary>What is AWS Athena?</summary><br><b>
19202016

@@ -2026,6 +2122,15 @@ AWS definition: "Amazon Simple Queue Service (SQS) is a fully managed message qu
20262122
Learn more about it [here](https://aws.amazon.com/sqs)
20272123
</b></details>
20282124

2125+
#### AWS - High Availability
2126+
2127+
<details>
2128+
<summary>What high availability means from AWS perspective?</summary><br><b>
2129+
2130+
* Application/Service is running in at least 2 availability zones
2131+
* Application/Service should survive (= operate as usual) a data center disaster
2132+
</b></details>
2133+
20292134
#### AWS - Production
20302135

20312136
<details>
@@ -2042,8 +2147,36 @@ One way is through launching a new instance. In more detail:
20422147
...
20432148
</b></details>
20442149

2150+
<details>
2151+
<summary>You try to use an detached EBS volume from us-east-1b in us-east-1a, but it fails. What might be the reason?</summary><br><b>
2152+
2153+
EBS volumes are locked to a specific availability zone. To use them in another availability zone, you need to take a snapshot and restore it in the destination availability zone.
2154+
</b></details>
2155+
20452156
<details>
20462157
<summary>When you launch EC2 instances, it takes them time to boot due to commands you run with user data. How to improve instances boot time?</summary><br><b>
20472158

20482159
Consider creating customized AMI with the commands from user data already executed there. This will allow you launch instance instantly.
20492160
</b></details>
2161+
2162+
<details>
2163+
<summary>You try to mount EFS on your EC2 instance and it doesn't work (hangs...) What might be a possible reason?</summary><br><b>
2164+
2165+
Security group isn't attached to your EFS or it lacks a rule to allow NFS traffic.
2166+
</b></details>
2167+
2168+
<details>
2169+
<summary>How to migrate an EBS volume across availability zones?</summary><br><b>
2170+
2171+
1. Pause the application
2172+
2. Take a snapshot of the EBS volume
2173+
3. Restore the snapshot in another availability zone
2174+
</b></details>
2175+
2176+
<details>
2177+
<summary>How to encrypt an unencrypted EBS volume attached to an EC2 instance?</summary><br><b>
2178+
2179+
1. Create EBS snapshot of the volume
2180+
2. Copy the snapshot and mark the "Encrypt" option
2181+
3. Create a new EBS volume out of the encrypted snapshot
2182+
</b></details>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## AWS ELB - ALB Multiple Target Groups
2+
3+
### Requirements
4+
5+
Two EC2 instances with a simple web application that shows the web page with the string "Hey, it's a me, `<HOSTNAME>`!"
6+
One EC2 instance with a simple web application that shows the web page with the string "Hey, it's only a test..." under the endpoint /test
7+
8+
### Objectives
9+
10+
1. Create an application load balancer for the two instances you have, with the following properties
11+
1. healthy threshold: 3
12+
2. unhealthy threshold: 3
13+
3. interval: 10 seconds
14+
2. Create another target group
15+
1. Traffic should be forwarded to this group based on the "/test" path

exercises/aws/app_load_balancer.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## AWS ELB - Application Load Balancer
2+
3+
### Requirements
4+
5+
Two EC2 instances with a simple web application that shows the web page with the string "Hey, it's a me, `<HOSTNAME>`!"
6+
7+
### Objectives
8+
9+
1. Create an application load balancer for the two instances you have, with the following properties
10+
1. healthy threshold: 3
11+
2. unhealthy threshold: 3
12+
3. interval: 10 seconds
13+
2. Verify load balancer is working (= you get reply from both instances at different times)

exercises/aws/create_efs.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## AWS - Create EFS
2+
3+
### Requirements
4+
5+
Two EC2 instances in different availability zones
6+
7+
### Objectives
8+
9+
1. Create an EFS with the following properties
10+
1. Set lifecycle management to 60 days
11+
2. The mode should match a use case of scaling to high levels of throughput and I/O operations per second
12+
2. Mount the EFS in both of your EC2 instances

0 commit comments

Comments
 (0)