-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinternal_alb.tf
More file actions
58 lines (54 loc) · 1.77 KB
/
internal_alb.tf
File metadata and controls
58 lines (54 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
module "internal_alb" {
source = "git::https://github.com/terraform-aws-modules/terraform-aws-alb?ref=v4.1.0"
load_balancer_name = var.internal_alb_name
security_groups = [aws_security_group.alb_security_group.id]
log_bucket_name = aws_s3_bucket.log_bucket.bucket
log_location_prefix = "internal-alb"
load_balancer_is_internal = "true"
subnets = var.public_subnet_ids
tags = {
"environment" = var.environment
"stack" = var.stack_name
}
vpc_id = var.vpc_id
http_tcp_listeners = [
{
port = "80"
protocol = "HTTP"
},
]
http_tcp_listeners_count = "1"
target_groups = [
{
name = var.internal_default_tg
backend_protocol = "HTTP"
backend_port = "80"
},
]
target_groups_defaults = {
cookie_duration = 86400
deregistration_delay = 300
health_check_interval = 10
health_check_healthy_threshold = 3
health_check_path = "/"
health_check_port = "traffic-port"
health_check_timeout = 5
health_check_unhealthy_threshold = 3
health_check_matcher = "200-299"
stickiness_enabled = false
target_type = "instance"
slow_start = 0
}
target_groups_count = "1"
}
resource "aws_route53_record" "internal_record_set" {
count = var.internal_route53_enabled == "true" ? 1 : 0
name = var.internal_route53_record
type = "A"
zone_id = var.internal_alb_zone_id
alias {
name = module.internal_alb.dns_name
zone_id = data.aws_elb_hosted_zone_id.main.id
evaluate_target_health = true
}
}