Skip to content

Commit 4a084dd

Browse files
committed
elb demos updated
1 parent 8f7b86c commit 4a084dd

File tree

5 files changed

+41
-14
lines changed

5 files changed

+41
-14
lines changed

04-cloud/aws/09-elb/demos/01-setup/readme.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ VPC_ID=$(aws ec2 create-vpc --cidr-block 172.31.0.0/16 \
7171
| jq -r '.Vpc."VpcId"')
7272
```
7373

74-
> Enable DNS hostnames from console
74+
> Enable DNS hostnames from console or using AWS CLI as follows:
75+
76+
```bash
77+
aws ec2 modify-vpc-attribute --vpc-id $VPC_ID --enable-dns-hostnames "{\"Value\":true}"
78+
```
7579

7680
### Create web tier subnets
7781

@@ -193,6 +197,8 @@ IMAGE_ID=ami-0302f42a44bf53a45
193197

194198
### Create web instances
195199

200+
> Ensure that `devops_trainer_key` is created in the desired region
201+
196202
```bash
197203
aws ec2 run-instances \
198204
--image-id $IMAGE_ID \
@@ -202,7 +208,7 @@ aws ec2 run-instances \
202208
--security-group-ids $WEBSG \
203209
--associate-public-ip-address \
204210
--private-ip-address 172.31.1.21 \
205-
--tag-specifications ResourceType=instance,Tags='[{Key=name,Value=web1}]'
211+
--tag-specifications ResourceType=instance,Tags='[{Key=Name,Value=web1}]'
206212
```
207213

208214
```bash
@@ -214,7 +220,7 @@ aws ec2 run-instances \
214220
--security-group-ids $WEBSG \
215221
--associate-public-ip-address \
216222
--private-ip-address 172.31.2.22 \
217-
--tag-specifications ResourceType=instance,Tags='[{Key=name,Value=web2}]'
223+
--tag-specifications ResourceType=instance,Tags='[{Key=Name,Value=web2}]'
218224
```
219225

220226
```bash

04-cloud/aws/09-elb/demos/02-user-data/readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Create `install-docker.txt`
66

77
```bash
88
#!/bin/bash
9-
sudo dnf update
10-
sudo dnf install docker -y
9+
sudo yum update -y
10+
sudo yum install -y docker
1111
sudo systemctl start docker
1212
sudo systemctl enable docker
1313
sudo usermod -aG docker $USER
@@ -59,7 +59,7 @@ With this we're finally ready to try to start our instance with user data:
5959
> NOTE: We have taken the image id from region AMI Catalog
6060
6161
```bash
62-
aws ec2 run-instances --image-id ami-07355fe79b493752d \
62+
aws ec2 run-instances --image-id ami-0ef0975ebdd78b77b \
6363
--count 1 --instance-type t3.micro \
6464
--key-name dublin_key --subnet-id $SUBNET --security-group-ids $SSHSG \
6565
--region eu-west-1 \

04-cloud/aws/09-elb/demos/03-web-tier-deploy/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Demo
22

3-
We're going to SSH into web1 and deploy the web front end using `Docker`. We're then going to browse directly to web1's public IP address and verify that the web front end is actually working.
3+
We're going to SSH into web1 and deploy the web front end using `Docker`. We're then going to browse directly to web1's public IP address and verify that the web frontend is actually working.
44

55
- SSH into `web1`
66
- Deploy the front end using Docker

04-cloud/aws/09-elb/demos/10-provisioning-db/readme.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ ssh -i "your_key" ec2-user@<public_dns>
99
Install Docker
1010

1111
```bash
12-
sudo dnf update
13-
sudo dnf install docker -y
12+
# Install Docker
13+
sudo yum update -y
14+
sudo yum install -y docker
1415
sudo systemctl start docker
1516
sudo systemctl enable docker
16-
sudo usermod -aG docker $USER
17+
sudo usermod -aG docker $USER
1718
newgrp docker
1819
```
1920

@@ -30,7 +31,7 @@ docker run -d -p 27017:27017 \
3031

3132
Connect to an app tier instance, for example `app1`
3233

33-
Ping to db instance
34+
Ping to db instance using the private DNS
3435

3536
```bash
3637
nslookup ip-172-31-101-99.eu-west-3.compute.internal
@@ -51,7 +52,7 @@ Check Mongo connectivity. Test Mongo connectivity. From EC2 Dashboard, we can ch
5152
- 172.31.101.99
5253

5354
```bash
54-
sudo dnf -y install telnet
55+
sudo yum -y install telnet
5556
telnet ip-172-31-101-99.eu-west-3.compute.internal 27017
5657
```
5758

04-cloud/aws/09-elb/readme.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,26 @@ Right now, we need to SSH into each machine to install Docker. We can avoid this
5050

5151
## Creating and HTTP Target Group
5252

53+
### What is a Target Group?
54+
55+
A target group in AWS is a key component of Elastic Load Balancing (ELB) that serves as a logical grouping of targets to which traffic can be routed. Here are the main points about target groups:
56+
57+
1. Purpose: Target groups are used to distribute incoming traffic across multiple targets, such as EC2 instances, IP addresses, or Lambda functions.
58+
59+
2. Load Balancer Association: They are associated with Application Load Balancers, Network Load Balancers, or Gateway Load Balancers to define where traffic should be directed.
60+
61+
3. Health Checks: Target groups allow you to configure health checks to ensure that traffic is only routed to healthy targets.
62+
63+
4. Routing Rules: You can create routing rules in your load balancer to direct specific types of requests to different target groups.
64+
65+
5. Auto Scaling Integration: Target groups can be used with Auto Scaling groups to automatically register or deregister instances as they are launched or terminated.
66+
67+
6. Flexibility: You can register the same target with multiple target groups, allowing for flexible traffic distribution strategies.
68+
69+
7. Attributes: Target groups have configurable attributes such as deregistration delay, load balancing algorithm, and stickiness settings.
70+
71+
8. Monitoring: They provide metrics and health status information for your targets, helping you monitor the performance of your application.
72+
5373
### Supported Protocols
5474

5575
- HTTP
@@ -117,11 +137,11 @@ We're going to deploy the web front end on `web2` and `web3` and add those insta
117137

118138
### Stickiness Duration
119139

120-
- How long load balancer will maintain sticky session between clinet and target
140+
- How long load balancer will maintain sticky session between client and target
121141
- Load balancer sets a browser cookie with a unique, encrypted value
122142
- Client sends back the cookie with each subsequent request
123143
- Between 1 second and 7 days
124144

125145
[Demo: Sticky Sessions](./demos/11-sticky-session/readme.md)
126146

127-
[Demo: Idle Timeout]()
147+
[Demo: Idle Timeout](./demos/12-idle-timeout.md/readme.md)

0 commit comments

Comments
 (0)