Skip to content

Commit 7c1c718

Browse files
committed
fix: 타겟그룹 해제 시간 단축
1 parent e5fc020 commit 7c1c718

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

terraform/common/alb/locals.tf

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ locals {
33
deletion_protection = false
44
loadbalancer_type = "application"
55
internal = false
6+
67
alb_tags = {
78
Environment = local.alb_name
89
}
@@ -11,10 +12,11 @@ locals {
1112
locals {
1213
target_groups = {
1314
"api-dev" = {
14-
env = "dev"
15-
port = 8080
16-
protocol = "HTTP"
17-
target_type = "instance"
15+
env = "dev"
16+
port = 8080
17+
protocol = "HTTP"
18+
target_type = "instance"
19+
deregistration_delay = 60
1820
health_check = {
1921
path = "/actuator/health/"
2022
protocol = "HTTP"
@@ -25,10 +27,11 @@ locals {
2527
}
2628
}
2729
"api-prod" = {
28-
env = "prod"
29-
port = 8080
30-
protocol = "HTTP"
31-
target_type = "instance"
30+
env = "prod"
31+
port = 8080
32+
protocol = "HTTP"
33+
target_type = "instance"
34+
deregistration_delay = 60
3235
health_check = {
3336
path = "/actuator/health"
3437
protocol = "HTTP"

terraform/common/alb/target-group/main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
resource "aws_lb_target_group" "common" {
22
for_each = var.target_groups
33

4-
name = each.key
5-
port = each.value.port
6-
protocol = each.value.protocol
7-
target_type = each.value.target_type
4+
name = each.key
5+
port = each.value.port
6+
protocol = each.value.protocol
7+
target_type = each.value.target_type
8+
deregistration_delay = each.value.deregistration_delay
89

910
vpc_id = var.vpc_id
1011

terraform/common/alb/target-group/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ variable "target_groups" {
33
port = number
44
protocol = string
55
target_type = string
6+
deregistration_delay = number
67
health_check = object({
78
path = string
89
protocol = string

0 commit comments

Comments
 (0)