The AWS console allows an NLB target group to be configured to preserve client IP addresses:
However, this setting doesn't appear to be available in Terraform's load balancer target group: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group
How can I enable this option through Terraform, or is it not supported?
Preserve client IP addresses is an option within the Attributes section of a load balancer target group. Other options there are Proxy protocol v2, Stickiness, Connection termination on deregistration and Deregistration delay. The Terraform LB target group includes proxy_protocol_v2
, stickiness
and deregistration_delay
, but not the other two options (as far as I can see).
As of v3.35.0 of the AWS provider, it is now possible.
Looks like it's not possible to configure via Terraform at the moment, but at least it doesn't get overwritten if you set it manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With