Skip to content

Commit 0cb7aff

Browse files
authored
feat: Support HTTPS request headers renaming (#402)
1 parent cae590e commit 0cb7aff

File tree

5 files changed

+35
-4
lines changed

5 files changed

+35
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,13 @@ See [patterns.md](https://github.com/terraform-aws-modules/terraform-aws-alb/blo
352352
| Name | Version |
353353
|------|---------|
354354
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
355-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.89 |
355+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.93 |
356356

357357
## Providers
358358

359359
| Name | Version |
360360
|------|---------|
361-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.89 |
361+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.93 |
362362

363363
## Modules
364364

examples/complete-alb/main.tf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,28 @@ module "alb" {
384384
routing_http_response_x_content_type_options_header_value = "nosniff"
385385
routing_http_response_x_frame_options_header_value = "SAMEORIGIN"
386386
}
387+
388+
ex-request-headers = {
389+
port = "443"
390+
protocol = "HTTPS"
391+
ssl_policy = "ELBSecurityPolicy-TLS13-1-2-Res-2021-06"
392+
certificate_arn = module.acm.acm_certificate_arn
393+
394+
fixed_response = {
395+
content_type = "text/plain"
396+
message_body = "Fixed message"
397+
status_code = "200"
398+
}
399+
400+
routing_http_request_x_amzn_tls_version_header_name = "X-Amzn-Tls-Version-Custom"
401+
routing_http_request_x_amzn_tls_cipher_suite_header_name = "X-Amzn-Tls-Cipher-Suite-Custom"
402+
routing_http_request_x_amzn_mtls_clientcert_header_name = "X-Amzn-Mtls-Clientcert-Custom"
403+
routing_http_request_x_amzn_mtls_clientcert_serial_number_header_name = "X-Amzn-Mtls-Clientcert-Serial-Number-Custom"
404+
routing_http_request_x_amzn_mtls_clientcert_issuer_header_name = "X-Amzn-Mtls-Clientcert-Issuer-Custom"
405+
routing_http_request_x_amzn_mtls_clientcert_subject_header_name = "X-Amzn-Mtls-Clientcert-Subject-Custom"
406+
routing_http_request_x_amzn_mtls_clientcert_validity_header_name = "X-Amzn-Mtls-Clientcert-Validity-Custom"
407+
routing_http_request_x_amzn_mtls_clientcert_leaf_header_name = "X-Amzn-Mtls-Clientcert-Leaf-Custom"
408+
}
387409
}
388410

389411
target_groups = {

main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,15 @@ resource "aws_lb_listener" "this" {
229229
routing_http_response_x_content_type_options_header_value = try(each.value.routing_http_response_x_content_type_options_header_value, null)
230230
routing_http_response_x_frame_options_header_value = try(each.value.routing_http_response_x_frame_options_header_value, null)
231231

232+
routing_http_request_x_amzn_tls_version_header_name = try(each.value.protocol, var.default_protocol, null) == "HTTPS" ? try(each.value.routing_http_request_x_amzn_tls_version_header_name, null) : null
233+
routing_http_request_x_amzn_tls_cipher_suite_header_name = try(each.value.protocol, var.default_protocol, null) == "HTTPS" ? try(each.value.routing_http_request_x_amzn_tls_cipher_suite_header_name, null) : null
234+
routing_http_request_x_amzn_mtls_clientcert_header_name = try(each.value.protocol, var.default_protocol, null) == "HTTPS" ? try(each.value.routing_http_request_x_amzn_mtls_clientcert_header_name, null) : null
235+
routing_http_request_x_amzn_mtls_clientcert_serial_number_header_name = try(each.value.protocol, var.default_protocol, null) == "HTTPS" ? try(each.value.routing_http_request_x_amzn_mtls_clientcert_serial_number_header_name, null) : null
236+
routing_http_request_x_amzn_mtls_clientcert_issuer_header_name = try(each.value.protocol, var.default_protocol, null) == "HTTPS" ? try(each.value.routing_http_request_x_amzn_mtls_clientcert_issuer_header_name, null) : null
237+
routing_http_request_x_amzn_mtls_clientcert_subject_header_name = try(each.value.protocol, var.default_protocol, null) == "HTTPS" ? try(each.value.routing_http_request_x_amzn_mtls_clientcert_subject_header_name, null) : null
238+
routing_http_request_x_amzn_mtls_clientcert_validity_header_name = try(each.value.protocol, var.default_protocol, null) == "HTTPS" ? try(each.value.routing_http_request_x_amzn_mtls_clientcert_validity_header_name, null) : null
239+
routing_http_request_x_amzn_mtls_clientcert_leaf_header_name = try(each.value.protocol, var.default_protocol, null) == "HTTPS" ? try(each.value.routing_http_request_x_amzn_mtls_clientcert_leaf_header_name, null) : null
240+
232241
load_balancer_arn = aws_lb.this[0].arn
233242
port = try(each.value.port, var.default_port)
234243
protocol = try(each.value.protocol, var.default_protocol)

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.89"
7+
version = ">= 5.93"
88
}
99
}
1010
}

wrappers/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.89"
7+
version = ">= 5.93"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)