Skip to content

Commit 7451e34

Browse files
tanmngbrandonjbjelland
authored andcommitted
Add variable to support setting cross-zone-load-balancing (#73)
1 parent 22b380c commit 7451e34

File tree

4 files changed

+28
-20
lines changed

4 files changed

+28
-20
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
111111
112112
| Name | Description | Type | Default | Required |
113113
|------|-------------|:----:|:-----:|:-----:|
114+
| enable_cross_zone_load_balancing | Indicates whether cross zone load balancing should be enabled in application load balancers. | string | `false` | no |
114115
| enable_deletion_protection | If true, deletion of the load balancer will be disabled via the AWS API. This will prevent Terraform from deleting the load balancer. Defaults to false. | string | `false` | no |
115116
| enable_http2 | Indicates whether HTTP/2 is enabled in application load balancers. | string | `true` | no |
116117
| extra_ssl_certs | A list of maps describing any extra SSL certificates to apply to the HTTPS listeners. Required key/values: certificate_arn, https_listener_index (the index of the listener within https_listeners which the cert applies toward). | list | `<list>` | no |

alb_no_logs.tf

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
resource "aws_lb" "application_no_logs" {
2-
load_balancer_type = "application"
3-
name = "${var.load_balancer_name}"
4-
internal = "${var.load_balancer_is_internal}"
5-
security_groups = ["${var.security_groups}"]
6-
subnets = ["${var.subnets}"]
7-
idle_timeout = "${var.idle_timeout}"
8-
enable_deletion_protection = "${var.enable_deletion_protection}"
9-
enable_http2 = "${var.enable_http2}"
10-
ip_address_type = "${var.ip_address_type}"
11-
tags = "${merge(var.tags, map("Name", var.load_balancer_name))}"
2+
load_balancer_type = "application"
3+
name = "${var.load_balancer_name}"
4+
internal = "${var.load_balancer_is_internal}"
5+
security_groups = ["${var.security_groups}"]
6+
subnets = ["${var.subnets}"]
7+
idle_timeout = "${var.idle_timeout}"
8+
enable_cross_zone_load_balancing = "${var.enable_cross_zone_load_balancing}"
9+
enable_deletion_protection = "${var.enable_deletion_protection}"
10+
enable_http2 = "${var.enable_http2}"
11+
ip_address_type = "${var.ip_address_type}"
12+
tags = "${merge(var.tags, map("Name", var.load_balancer_name))}"
1213

1314
timeouts {
1415
create = "${var.load_balancer_create_timeout}"

alb_w_logs.tf

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
resource "aws_lb" "application" {
2-
load_balancer_type = "application"
3-
name = "${var.load_balancer_name}"
4-
internal = "${var.load_balancer_is_internal}"
5-
security_groups = ["${var.security_groups}"]
6-
subnets = ["${var.subnets}"]
7-
idle_timeout = "${var.idle_timeout}"
8-
enable_deletion_protection = "${var.enable_deletion_protection}"
9-
enable_http2 = "${var.enable_http2}"
10-
ip_address_type = "${var.ip_address_type}"
11-
tags = "${merge(var.tags, map("Name", var.load_balancer_name))}"
2+
load_balancer_type = "application"
3+
name = "${var.load_balancer_name}"
4+
internal = "${var.load_balancer_is_internal}"
5+
security_groups = ["${var.security_groups}"]
6+
subnets = ["${var.subnets}"]
7+
idle_timeout = "${var.idle_timeout}"
8+
enable_cross_zone_load_balancing = "${var.enable_cross_zone_load_balancing}"
9+
enable_deletion_protection = "${var.enable_deletion_protection}"
10+
enable_http2 = "${var.enable_http2}"
11+
ip_address_type = "${var.ip_address_type}"
12+
tags = "${merge(var.tags, map("Name", var.load_balancer_name))}"
1213

1314
access_logs {
1415
enabled = true

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ variable "enable_http2" {
88
default = true
99
}
1010

11+
variable "enable_cross_zone_load_balancing" {
12+
description = "Indicates whether cross zone load balancing should be enabled in application load balancers."
13+
default = false
14+
}
15+
1116
variable "extra_ssl_certs" {
1217
description = "A list of maps describing any extra SSL certificates to apply to the HTTPS listeners. Required key/values: certificate_arn, https_listener_index (the index of the listener within https_listeners which the cert applies toward)."
1318
type = "list"

0 commit comments

Comments
 (0)