69d8496107
---ci--- project: acdl phase: 6 milestone: v1.14 status: complete requirements: covered: [REQ-140] partial: [] ---/ci---
31 lines
725 B
Terraform
31 lines
725 B
Terraform
resource "aws_lb" "this" {
|
|
name = var.name
|
|
load_balancer_type = var.load_balancer_type
|
|
subnets = local.subnet_list
|
|
security_groups = local.security_groups
|
|
}
|
|
|
|
resource "aws_lb_target_group" "this" {
|
|
name_prefix = "${var.name}-"
|
|
port = var.port
|
|
protocol = var.protocol
|
|
vpc_id = var.vpc_id
|
|
target_type = var.target_type
|
|
|
|
lifecycle {
|
|
create_before_destroy = true
|
|
}
|
|
}
|
|
|
|
resource "aws_lb_listener" "this" {
|
|
load_balancer_arn = aws_lb.this.id
|
|
port = var.port
|
|
protocol = var.protocol
|
|
|
|
default_action {
|
|
type = "forward"
|
|
target_group_arn = aws_lb_target_group.this.arn
|
|
}
|
|
|
|
depends_on = [aws_lb_target_group.this]
|
|
} |