Files
acdl/modules/l1/alb/terraform/main.tf
T
Jon Chery 69d8496107 docs(P06): complete alb-name-prefix-fix phase (v1.13.9)
---ci---
project: acdl
phase: 6
milestone: v1.14
status: complete
requirements:
  covered: [REQ-140]
  partial: []
---/ci---
2026-07-29 20:38:14 +00:00

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]
}