-
Notifications
You must be signed in to change notification settings - Fork 1
/
region1-alb.tf
53 lines (45 loc) · 1.22 KB
/
region1-alb.tf
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
module "alb1" {
source = "terraform-aws-modules/alb/aws"
version = "~> 8.0"
name = "harsh-viradia-alb"
load_balancer_type = "application"
vpc_id = aws_vpc.harsh-viradia-vpc-1.id
subnets = ["${aws_subnet.harsh-viradia-1-subnet1.id}", "${aws_subnet.harsh-viradia-1-subnet2.id}"]
security_groups = [module.web_security_group.security_group_id]
create_security_group = false
target_groups = [
{
name_prefix = "harsh-"
backend_protocol = "HTTP"
backend_port = 80
target_type = "instance"
stickiness = { "enabled" = true, "type" = "lb_cookie" }
health_check = {
matcher = "200-399"
path = "/icon/"
interval = 120
timeout = 30
}
}
]
http_tcp_listeners = [
{
port = 80
protocol = "HTTP"
action_type = "redirect"
redirect = {
port = "443"
protocol = "HTTPS"
status_code = "HTTP_301"
}
}
]
https_listeners = [
{
port = 443
protocol = "HTTPS"
certificate_arn = data.aws_acm_certificate.https_certificate.arn
target_group_index = 0
}
]
}