-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalb.tf
37 lines (31 loc) · 907 Bytes
/
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
module "alb" {
source = "terraform-aws-modules/alb/aws"
version = "5.16.0"
name = "bci-alb"
load_balancer_type = "application"
vpc_id = module.vpc.vpc_id
subnets = module.vpc.public_subnets
security_groups = [module.alb_sg.this_security_group_id]
http_tcp_listeners = [
{
port = 80
protocol = "HTTP"
target_group_index = 0
}
]
target_groups = [
{
backend_protocol = "HTTP"
backend_port = 80
target_type = "instance"
}
]
}
module "alb_sg" {
source = "terraform-aws-modules/security-group/aws//modules/http-80"
version = "3.18.0"
name = "bci-alb-sg"
description = "Security group for web-server with HTTP ports open within VPC"
vpc_id = module.vpc.vpc_id
ingress_cidr_blocks = ["0.0.0.0/0"]
}