Skip to content

Commit 708e57d

Browse files
committed
added custom TG health check /ok for api
1 parent cf9c3e8 commit 708e57d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

exercises/exercise4/modules/application/main.tf

+9-1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@ resource "aws_alb_target_group" "api" {
129129
vpc_id = var.vpc_id
130130
port = 8080
131131
protocol = "HTTP"
132+
133+
health_check {
134+
path = "/ok"
135+
interval = 5
136+
healthy_threshold = 3
137+
unhealthy_threshold = 6
138+
}
132139
}
133140

134141
resource "aws_alb_listener" "front_end" {
@@ -167,7 +174,8 @@ resource "aws_alb_listener_rule" "api_rule1" {
167174
values = [
168175
"/languages",
169176
"/languages/*",
170-
"/languages/*/*"
177+
"/languages/*/*",
178+
"/ok"
171179
]
172180
}
173181
}

exercises/exercise4/modules/security/main.tf

-8
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ resource "aws_security_group" "alb" {
3636
cidr_blocks = ["0.0.0.0/0"]
3737
}
3838

39-
ingress {
40-
description = "8080 from anywhere"
41-
from_port = 8080
42-
to_port = 8080
43-
protocol = "tcp"
44-
cidr_blocks = ["0.0.0.0/0"]
45-
}
46-
4739
egress {
4840
from_port = 0
4941
to_port = 0

0 commit comments

Comments
 (0)