Skip to content

Commit e0846c2

Browse files
tbpoetkeThomas Pötke
andauthored
add xff_header_processing_mode option to alb (#143)
* add xff_header_processing_mode option to alb * update docs --------- Co-authored-by: Thomas Pötke <thomas.poetke@exconcept.com>
1 parent 27f69b1 commit e0846c2

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ Available targets:
319319
| <a name="input_target_group_target_type"></a> [target\_group\_target\_type](#input\_target\_group\_target\_type) | The type (`instance`, `ip` or `lambda`) of targets that can be registered with the target group | `string` | `"ip"` | no |
320320
| <a name="input_tenant"></a> [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
321321
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | VPC ID to associate with ALB | `string` | n/a | yes |
322+
| <a name="input_xff_header_processing_mode"></a> [xff\_header\_processing\_mode](#input\_xff\_header\_processing\_mode) | Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append | `string` | `"append"` | no |
322323

323324
## Outputs
324325

docs/terraform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
| <a name="input_target_group_target_type"></a> [target\_group\_target\_type](#input\_target\_group\_target\_type) | The type (`instance`, `ip` or `lambda`) of targets that can be registered with the target group | `string` | `"ip"` | no |
120120
| <a name="input_tenant"></a> [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
121121
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | VPC ID to associate with ALB | `string` | n/a | yes |
122+
| <a name="input_xff_header_processing_mode"></a> [xff\_header\_processing\_mode](#input\_xff\_header\_processing\_mode) | Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append | `string` | `"append"` | no |
122123

123124
## Outputs
124125

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ resource "aws_lb" "default" {
8888
enable_deletion_protection = var.deletion_protection_enabled
8989
drop_invalid_header_fields = var.drop_invalid_header_fields
9090
preserve_host_header = var.preserve_host_header
91+
xff_header_processing_mode = var.xff_header_processing_mode
9192

9293
access_logs {
9394
bucket = try(element(compact([var.access_logs_s3_bucket_id, module.access_logs.bucket_id]), 0), "")

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,9 @@ variable "preserve_host_header" {
348348
default = false
349349
description = "Indicates whether the Application Load Balancer should preserve the Host header in the HTTP request and send it to the target without any change."
350350
}
351+
352+
variable "xff_header_processing_mode" {
353+
type = string
354+
default = "append"
355+
description = "Determines how the load balancer modifies the X-Forwarded-For header in the HTTP request before sending the request to the target. The possible values are append, preserve, and remove. Only valid for Load Balancers of type application. The default is append"
356+
}

0 commit comments

Comments
 (0)