Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
limit load balancer name lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
drpebcak committed Oct 24, 2019
1 parent fc2bd8d commit 0084638
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions loadbalancer.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "random_pet" "lb" {}

resource "aws_lb" "server-lb" {
name = "${local.name}-int-${random_pet.lb.id}"
name = substr("${local.name}-int-${random_pet.lb.id}", 0, 24)
internal = true
load_balancer_type = "network"
subnets = local.private_subnets
Expand All @@ -19,7 +19,7 @@ resource "aws_lb_listener" "server-port_6443" {
}

resource "aws_lb_target_group" "server-6443" {
name = "${local.name}-6443-${random_pet.lb.id}"
name = substr("${local.name}-6443-${random_pet.lb.id}", 0, 24)
port = 6443
protocol = "TCP"
vpc_id = data.aws_vpc.default.id
Expand All @@ -28,7 +28,7 @@ resource "aws_lb_target_group" "server-6443" {

resource "aws_lb" "lb" {
count = local.create_external_nlb
name = "${local.name}-ext-${random_pet.lb.id}"
name = substr("${local.name}-ext-${random_pet.lb.id}", 0, 24)
internal = false
load_balancer_type = "network"
subnets = local.public_subnets
Expand Down Expand Up @@ -64,7 +64,7 @@ resource "aws_lb_listener" "port_80" {

resource "aws_lb_target_group" "agent-443" {
count = local.create_external_nlb
name = "${local.name}-443-${random_pet.lb.id}"
name = substr("${local.name}-443-${random_pet.lb.id}", 0, 24)
port = 443
protocol = "TCP"
vpc_id = data.aws_vpc.default.id
Expand All @@ -87,7 +87,7 @@ resource "aws_lb_target_group" "agent-443" {

resource "aws_lb_target_group" "agent-80" {
count = local.create_external_nlb
name = "${local.name}-80-${random_pet.lb.id}"
name = substr("${local.name}-80-${random_pet.lb.id}", 0, 24)
port = 80
protocol = "TCP"
vpc_id = data.aws_vpc.default.id
Expand Down

0 comments on commit 0084638

Please sign in to comment.