-
Notifications
You must be signed in to change notification settings - Fork 8
/
lb.tf
32 lines (30 loc) · 893 Bytes
/
lb.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
resource "aws_lb" "bastion" {
name = var.name
internal = false
load_balancer_type = "network"
subnets = var.public_subnets
enable_deletion_protection = true
}
resource "aws_lb_target_group" "bastion" {
name = var.name
port = var.ssh_port
protocol = "TCP"
vpc_id = var.vpc_id
deregistration_delay = "30"
health_check {
interval = "30"
port = var.ssh_port
protocol = "TCP"
healthy_threshold = "10"
unhealthy_threshold = "10"
}
}
resource "aws_lb_listener" "bastion" {
load_balancer_arn = aws_lb.bastion.arn
port = var.ssh_port
protocol = "TCP"
default_action {
target_group_arn = aws_lb_target_group.bastion.arn
type = "forward"
}
}