Skip to content

Commit bf7dda6

Browse files
committed
refactor(modules/alb): remove unnecessary usage of try for existing variables, set default values for name to null and preserve_host_header to true
1 parent d105ceb commit bf7dda6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

modules/alb/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ locals {
77
################################################################################
88

99
resource "aws_lb" "this" {
10-
name = try(var.name, null)
11-
load_balancer_type = try(local.load_balancer_type, null)
12-
internal = try(var.internal, null)
10+
name = var.name
11+
load_balancer_type = local.load_balancer_type
12+
internal = var.internal
1313
subnets = var.subnets_ids
1414
security_groups = var.security_groups_ids
1515
preserve_host_header = var.preserve_host_header

modules/alb/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
variable "name" {
66
description = "(Optional) Name of the LB."
77
type = string
8-
default = ""
8+
default = null
99
}
1010

1111
variable "internal" {
@@ -28,7 +28,7 @@ variable "subnets_ids" {
2828
variable "preserve_host_header" {
2929
description = "(Optional) Whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change."
3030
type = bool
31-
default = false
31+
default = true
3232
}
3333

3434
variable "enable_deletion_protection" {

0 commit comments

Comments
 (0)