Skip to content

Commit ee664d0

Browse files
committed
refactor(modules/alb): remove unnecessary configuration
BREAKING CHANGE: This commit removes support for certain configuration.
1 parent 504c5b1 commit ee664d0

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

modules/alb/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ No modules.
3131
|------|-------------|------|---------|:--------:|
3232
| <a name="input_enable_deletion_protection"></a> [enable\_deletion\_protection](#input\_enable\_deletion\_protection) | (Optional) If true, deletion of the load balancer will be disabled via the AWS API. | `bool` | `false` | no |
3333
| <a name="input_internal"></a> [internal](#input\_internal) | (Optional) If true, the LB will be internal. | `bool` | `false` | no |
34-
| <a name="input_listeners"></a> [listeners](#input\_listeners) | Listeners to forward ALB ingress to desired Target Groups. | <pre>map(object({<br> default_action = list(object({<br> type = string<br> target_group = string<br> fixed_response = optional(any, null)<br> forward = optional(any, null)<br> order = optional(number)<br> redirect = optional(any, null)<br> }))<br> alpn_policy = optional(string)<br> certificate_arn = optional(string)<br> port = optional(number)<br> protocol = optional(string)<br> ssl_policy = optional(string)<br> tags = optional(map(string), {})<br> }))</pre> | n/a | yes |
34+
| <a name="input_listeners"></a> [listeners](#input\_listeners) | Listeners to forward ALB ingress to desired Target Groups. | <pre>map(object({<br> default_action = list(object({<br> type = string<br> target_group = string<br> fixed_response = optional(any, null)<br> forward = optional(any, null)<br> order = optional(number)<br> redirect = optional(any, null)<br> }))<br> certificate_arn = optional(string)<br> port = optional(number)<br> protocol = optional(string)<br> ssl_policy = optional(string)<br> tags = optional(map(string), {})<br> }))</pre> | n/a | yes |
3535
| <a name="input_name"></a> [name](#input\_name) | (Optional) Name of the LB. | `string` | `""` | no |
3636
| <a name="input_preserve_host_header"></a> [preserve\_host\_header](#input\_preserve\_host\_header) | (Optional) Whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change. | `bool` | `false` | no |
3737
| <a name="input_security_groups_ids"></a> [security\_groups\_ids](#input\_security\_groups\_ids) | (Optional) List of security group IDs to assign to the LB. | `list(string)` | `[]` | no |

modules/alb/main.tf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
locals {
2+
load_balancer_type = "application"
3+
}
4+
15
################################################################################
26
# Load Balancer
37
################################################################################
48

59
resource "aws_lb" "this" {
610
name = var.name
7-
load_balancer_type = "application"
11+
load_balancer_type = local.load_balancer_type
812
internal = var.internal
913

1014
subnets = var.subnets_ids
@@ -58,7 +62,6 @@ resource "aws_lb_listener" "this" {
5862

5963
load_balancer_arn = aws_lb.this.arn
6064

61-
alpn_policy = each.value.alpn_policy
6265
certificate_arn = each.value.certificate_arn
6366
port = each.value.port
6467
protocol = each.value.protocol

modules/alb/variables.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ variable "listeners" {
7676
order = optional(number)
7777
redirect = optional(any, null)
7878
}))
79-
alpn_policy = optional(string)
8079
certificate_arn = optional(string)
8180
port = optional(number)
8281
protocol = optional(string)

tests/alb_unit_tests.tftest.hcl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ run "lb_listener_attributes_match" {
212212

213213
listeners = {
214214
this = {
215-
alpn_policy = "HTTP2Preferred"
216215
certificate_arn = "arn:aws:acm:us-west-2:123456789012:certificate/12345678-1234-1234-1234-123456789012"
217216
port = 1234
218217
protocol = "HTTPS"
@@ -232,11 +231,6 @@ run "lb_listener_attributes_match" {
232231
}
233232
}
234233

235-
assert {
236-
condition = aws_lb_listener.this["this"].alpn_policy == var.listeners["this"].alpn_policy
237-
error_message = "ALPN policy mismatch"
238-
}
239-
240234
assert {
241235
condition = aws_lb_listener.this["this"].certificate_arn == var.listeners["this"].certificate_arn
242236
error_message = "Certificate ARN mismatch"

0 commit comments

Comments
 (0)