Skip to content

Commit 195174a

Browse files
author
abregman
committed
Add AWS exercise and questions
Mostly on Auto Scaling Groups.
1 parent 6aa674a commit 195174a

File tree

5 files changed

+120
-3
lines changed

5 files changed

+120
-3
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
:information_source:  This repo contains questions and exercises on various technical topics, sometimes related to DevOps and SRE
44

5-
:bar_chart:  There are currently **2112** exercises and questions
5+
:bar_chart:  There are currently **2138** exercises and questions
66

77
:books:  To learn more about DevOps and SRE, check the resources in [devops-resources](https://github.com/bregman-arie/devops-resources) repository
88

@@ -1884,9 +1884,11 @@ Using the `last` command.
18841884
#### Linux Hardware
18851885

18861886
<details>
1887-
<summary>Where can you find information on the processor?</summary><br><b>
1887+
<summary>Where can you find information on the processor (like number of CPUs)?</summary><br><b>
18881888

18891889
/proc/cpuinfo
1890+
1891+
You can also use `nproc` for number of processors
18901892
</b></details>
18911893

18921894
<details>

exercises/aws/README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ Note: Provided solutions are using the AWS console. It's recommended you'll use
3939
| Multiple Target Groups | ELB, ALB | [Exercise](alb_multiple_target_groups.md) | [Solution](solutions/alb_multiple_target_groups.md) | Easy |
4040
| Network Load Balancer | ELB, NLB | [Exercise](network_load_balancer.md) | [Solution](solutions/network_load_balancer.md) | Easy |
4141

42+
#### AWS - Auto Scaling Groups
43+
44+
|Name|Topic|Objective & Instructions|Solution|Comments|
45+
|--------|--------|------|----|----|
46+
| Auto Scaling Groups Basics | ASG | [Exercise](auto_scaling_groups_basics.md) | [Solution](solutions/auto_scaling_groups_basics.md) | Easy |
47+
4248
#### AWS - Lambda
4349

4450
|Name|Topic|Objective & Instructions|Solution|Comments|
@@ -1254,7 +1260,41 @@ False. It charges fir inter AZ data in network load balancer, but not in applica
12541260
True
12551261
</b></details>
12561262

1257-
#### AWS Security
1263+
<details>
1264+
<summary>Explain Deregistration Delay (or Connection Draining) in regards to ELB</summary><br><b>
1265+
1266+
The period of time or process of "draining" instances from requests/traffic (basically let it complete all active connections but don't start new ones) so it can be de-registered eventually and ELB won't send requests/traffic to it anymore.
1267+
</b></details>
1268+
1269+
#### AWS - Auto Scaling Group
1270+
1271+
<details>
1272+
<summary>Explain Auto Scaling Group</summary><br><b>
1273+
1274+
[Amazon Docs](https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html): "An Auto Scaling group contains a collection of Amazon EC2 instances that are treated as a logical grouping for the purposes of automatic scaling and management. An Auto Scaling group also enables you to use Amazon EC2 Auto Scaling features such as health check replacements and scaling policies"
1275+
</b></details>
1276+
1277+
<details>
1278+
<summary>You have two instance running as part of ASG. You change the desired capacity to 1. What will be the outcome of this change?</summary><br><b>
1279+
1280+
One of the instances will be terminated.
1281+
</b></details>
1282+
1283+
<details>
1284+
<summary>How can you customize the trigger for the scaling in/out of an auto scaling group?</summary><br><b>
1285+
1286+
One way is to use CloudWatch alarms where an alarm will monitor a metric and based on a certain value (or range) you can choose to scale-in or scale-out the ASG.
1287+
</b></details>
1288+
1289+
<details>
1290+
<summary>Provide examples to metrics/rules used for auto scaling</summary><br><b>
1291+
1292+
* Network In/Out
1293+
* Number of requests on ELB per instance
1294+
* Average CPU, RAM usage
1295+
</b></details>
1296+
1297+
#### AWS - Security
12581298

12591299
<details>
12601300
<summary>What is the shared responsibility model? What AWS is responsible for and what the user is responsible for based on the shared responsibility model?</summary><br><b>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## AWS Auto Scaling Groups - Basics
2+
3+
### Requirements
4+
5+
Zero EC2 instances running
6+
7+
### Objectives
8+
9+
A. Create a scaling group for web servers with the following properties:
10+
* Amazon Linux 2 AMI
11+
* t2.micro as the instance type
12+
* user data:
13+
```
14+
yum install -y httpd
15+
systemctl start httpd
16+
systemctl enable httpd
17+
```
18+
19+
B. Were new instances created since you created the auto scaling group? How many? Why?
20+
C. Change desired capacity to 2. Did it launch more instances?
21+
D. Change back the desired capacity to 1. What is the result of this action?
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## AWS Auto Scaling Groups - Basics
2+
3+
### Requirements
4+
5+
Zero EC2 instances running
6+
7+
### Objectives
8+
9+
A. Create a scaling group for web servers with the following properties:
10+
* Amazon Linux 2 AMI
11+
* t2.micro as the instance type
12+
* user data:
13+
```
14+
yum install -y httpd
15+
systemctl start httpd
16+
systemctl enable httpd
17+
```
18+
19+
B. Were new instances created since you created the auto scaling group? How many? Why?
20+
C. Change desired capacity to 2. Did it launch more instances?
21+
D. Change back the desired capacity to 1. What is the result of this action?
22+
23+
### Solution
24+
25+
#### Console
26+
27+
A.
28+
1. Go to EC2 service
29+
2. Click on "Auto Scaling Groups" under "Auto Scaling"
30+
3. Click on "Create Auto Scaling Group"
31+
4. Insert a name
32+
5. Click on "Create a launch template"
33+
1. Insert a name and a version for the template
34+
2. Select an AMI to use (Amazon Linux 2)
35+
3. Select t2.micro instance type
36+
4. Select a key pair
37+
5. Attach a security group
38+
6. Under "Advanced" insert the user data
39+
7. Click on "Create"
40+
6. Choose the launch template you've just created and click on "Next"
41+
7. Choose "Adhere to launch template"
42+
8. Choose in which AZs to launch and click on "Next"
43+
9. Link it to ALB (if you don't have one, create it)
44+
10. Mark ELB health check in addition to EC2. Click on "Next" until you reach the review page and click on "Create auto scaling group"
45+
46+
B. One instance was launched to met the criteria of the auto scaling group we've created. The reason it launched only one is due to "Desired capacity" set to 1.
47+
C. Change it by going to your auto scaling group -> Details -> Edit -> "2 desired capacity". This should create another instance if only one is running
48+
D. Reducing desired capacity back to 1 will terminate one of the instances (assuming 2 are running).

exercises/security/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,12 @@ SNI allows a single server to serve multiple certificates using the same IP and
408408
Practically this means that a single IP can server multiple web services/pages, each using a different certificate.
409409
</b></details>
410410

411+
<details>
412+
<summary>Explain "Web Cache Deception Attach"</summary><br><b>
413+
414+
[This blog post](https://omergil.blogspot.com/2017/02/web-cache-deception-attack.html) explains it in detail.
415+
</b></details>
416+
411417
#### Security - Threats
412418

413419
<details>

0 commit comments

Comments
 (0)