Skip to content

Commit 1d1c75f

Browse files
authored
feat: Add ability to enable cross-zone load balancing (#326)
add possibility of enabling cross-zone load balancing
1 parent e83696f commit 1d1c75f

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ allow_github_webhooks = true
329329
| <a name="input_alb_authenticate_cognito"></a> [alb\_authenticate\_cognito](#input\_alb\_authenticate\_cognito) | Map of AWS Cognito authentication parameters to protect ALB (eg, using SAML). See https://www.terraform.io/docs/providers/aws/r/lb_listener.html#authenticate-cognito-action | `any` | `{}` | no |
330330
| <a name="input_alb_authenticate_oidc"></a> [alb\_authenticate\_oidc](#input\_alb\_authenticate\_oidc) | Map of Authenticate OIDC parameters to protect ALB (eg, using Auth0). See https://www.terraform.io/docs/providers/aws/r/lb_listener.html#authenticate-oidc-action | `any` | `{}` | no |
331331
| <a name="input_alb_drop_invalid_header_fields"></a> [alb\_drop\_invalid\_header\_fields](#input\_alb\_drop\_invalid\_header\_fields) | Indicates whether invalid header fields are dropped in application load balancers. Defaults to false. | `bool` | `null` | no |
332+
| <a name="input_alb_enable_cross_zone_load_balancing"></a> [alb\_enable\_cross\_zone\_load\_balancing](#input\_alb\_enable\_cross\_zone\_load\_balancing) | Whether cross-zone load balancing is enabled for the load balancer | `bool` | `null` | no |
332333
| <a name="input_alb_enable_deletion_protection"></a> [alb\_enable\_deletion\_protection](#input\_alb\_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. | `bool` | `null` | no |
333334
| <a name="input_alb_http_security_group_tags"></a> [alb\_http\_security\_group\_tags](#input\_alb\_http\_security\_group\_tags) | Additional tags to put on the http security group | `map(string)` | `{}` | no |
334335
| <a name="input_alb_https_security_group_tags"></a> [alb\_https\_security\_group\_tags](#input\_alb\_https\_security\_group\_tags) | Additional tags to put on the https security group | `map(string)` | `{}` | no |

examples/github-complete/main.tf

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,13 @@ module "atlantis" {
101101
atlantis_repo_allowlist = [for repo in var.github_repo_names : "github.com/${var.github_owner}/${repo}"]
102102

103103
# ALB access
104-
alb_ingress_cidr_blocks = var.alb_ingress_cidr_blocks
105-
alb_logging_enabled = true
106-
alb_log_bucket_name = module.atlantis_access_log_bucket.s3_bucket_id
107-
alb_log_location_prefix = "atlantis-alb"
108-
alb_listener_ssl_policy_default = "ELBSecurityPolicy-TLS-1-2-2017-01"
109-
alb_drop_invalid_header_fields = true
104+
alb_ingress_cidr_blocks = var.alb_ingress_cidr_blocks
105+
alb_logging_enabled = true
106+
alb_log_bucket_name = module.atlantis_access_log_bucket.s3_bucket_id
107+
alb_log_location_prefix = "atlantis-alb"
108+
alb_listener_ssl_policy_default = "ELBSecurityPolicy-TLS-1-2-2017-01"
109+
alb_drop_invalid_header_fields = true
110+
alb_enable_cross_zone_load_balancing = true
110111

111112
allow_unauthenticated_access = true
112113
allow_github_webhooks = true

main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,10 @@ module "alb" {
242242
name = var.name
243243
internal = var.internal
244244

245-
vpc_id = local.vpc_id
246-
subnets = local.public_subnet_ids
247-
security_groups = flatten([module.alb_https_sg.security_group_id, module.alb_http_sg.security_group_id, var.security_group_ids])
245+
enable_cross_zone_load_balancing = var.alb_enable_cross_zone_load_balancing
246+
vpc_id = local.vpc_id
247+
subnets = local.public_subnet_ids
248+
security_groups = flatten([module.alb_https_sg.security_group_id, module.alb_http_sg.security_group_id, var.security_group_ids])
248249

249250
access_logs = {
250251
enabled = var.alb_logging_enabled

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,3 +766,9 @@ variable "max_session_duration" {
766766
type = number
767767
default = null
768768
}
769+
770+
variable "alb_enable_cross_zone_load_balancing" {
771+
description = "Whether cross-zone load balancing is enabled for the load balancer"
772+
type = bool
773+
default = null
774+
}

0 commit comments

Comments
 (0)