Enum XffHeaderProcessingMode

java.lang.Object
java.lang.Enum<XffHeaderProcessingMode>
software.amazon.awscdk.services.elasticloadbalancingv2.XffHeaderProcessingMode
All Implemented Interfaces:
Serializable, Comparable<XffHeaderProcessingMode>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-15T10:24:59.461Z") @Stability(Stable) public enum XffHeaderProcessingMode extends Enum<XffHeaderProcessingMode>
Processing mode of the X-Forwarded-For header in the HTTP request before the Application Load Balancer sends the request to the target.

Example:

 Vpc vpc;
 ApplicationLoadBalancer lb = ApplicationLoadBalancer.Builder.create(this, "LB")
         .vpc(vpc)
         .internetFacing(true)
         // Whether HTTP/2 is enabled
         .http2Enabled(false)
         // The idle timeout value, in seconds
         .idleTimeout(Duration.seconds(1000))
         // Whether HTTP headers with header fields thatare not valid
         // are removed by the load balancer (true), or routed to targets
         .dropInvalidHeaderFields(true)
         // How the load balancer handles requests that might
         // pose a security risk to your application
         .desyncMitigationMode(DesyncMitigationMode.DEFENSIVE)
         // The type of IP addresses to use.
         .ipAddressType(IpAddressType.IPV4)
         // The duration of client keep-alive connections
         .clientKeepAlive(Duration.seconds(500))
         // Whether cross-zone load balancing is enabled.
         .crossZoneEnabled(true)
         // Whether the load balancer blocks traffic through the Internet Gateway (IGW).
         .denyAllIgwTraffic(false)
         // Whether to preserve host header in the request to the target
         .preserveHostHeader(true)
         // Whether to add the TLS information header to the request
         .xAmznTlsVersionAndCipherSuiteHeaders(true)
         // Whether the X-Forwarded-For header should preserve the source port
         .preserveXffClientPort(true)
         // The processing mode for X-Forwarded-For headers
         .xffHeaderProcessingMode(XffHeaderProcessingMode.APPEND)
         // Whether to allow a load balancer to route requests to targets if it is unable to forward the request to AWS WAF.
         .wafFailOpen(true)
         .build();
 
  • Enum Constant Details

    • APPEND

      @Stability(Stable) public static final XffHeaderProcessingMode APPEND
      Application Load Balancer adds the client IP address (of the last hop) to the X-Forwarded-For header in the HTTP request before it sends it to targets.
    • PRESERVE

      @Stability(Stable) public static final XffHeaderProcessingMode PRESERVE
      Application Load Balancer preserves the X-Forwarded-For header in the HTTP request, and sends it to targets without any change.
    • REMOVE

      @Stability(Stable) public static final XffHeaderProcessingMode REMOVE
      Application Load Balancer removes the X-Forwarded-For header in the HTTP request before it sends it to targets.
  • Method Details

    • values

      public static XffHeaderProcessingMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static XffHeaderProcessingMode valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null