Class NetworkListener.Builder

java.lang.Object
software.amazon.awscdk.services.elasticloadbalancingv2.NetworkListener.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<NetworkListener>
Enclosing class:
NetworkListener

@Stability(Stable) public static final class NetworkListener.Builder extends Object implements software.amazon.jsii.Builder<NetworkListener>
A fluent builder for NetworkListener.
  • Method Details

    • create

      @Stability(Stable) public static NetworkListener.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of NetworkListener.Builder.
    • port

      @Stability(Stable) public NetworkListener.Builder port(Number port)
      The port on which the listener listens for requests.

      Parameters:
      port - The port on which the listener listens for requests. This parameter is required.
      Returns:
      this
    • alpnPolicy

      @Stability(Stable) public NetworkListener.Builder alpnPolicy(AlpnPolicy alpnPolicy)
      Application-Layer Protocol Negotiation (ALPN) is a TLS extension that is sent on the initial TLS handshake hello messages.

      ALPN enables the application layer to negotiate which protocols should be used over a secure connection, such as HTTP/1 and HTTP/2.

      Can only be specified together with Protocol TLS.

      Default: - None

      Parameters:
      alpnPolicy - Application-Layer Protocol Negotiation (ALPN) is a TLS extension that is sent on the initial TLS handshake hello messages. This parameter is required.
      Returns:
      this
    • certificates

      @Stability(Stable) public NetworkListener.Builder certificates(List<? extends IListenerCertificate> certificates)
      Certificate list of ACM cert ARNs.

      You must provide exactly one certificate if the listener protocol is HTTPS or TLS.

      Default: - No certificates.

      Parameters:
      certificates - Certificate list of ACM cert ARNs. This parameter is required.
      Returns:
      this
    • defaultAction

      @Stability(Stable) public NetworkListener.Builder defaultAction(NetworkListenerAction defaultAction)
      Default action to take for requests to this listener.

      This allows full control of the default Action of the load balancer, including weighted forwarding. See the NetworkListenerAction class for all options.

      Cannot be specified together with defaultTargetGroups.

      Default: - None.

      Parameters:
      defaultAction - Default action to take for requests to this listener. This parameter is required.
      Returns:
      this
    • defaultTargetGroups

      @Stability(Stable) public NetworkListener.Builder defaultTargetGroups(List<? extends INetworkTargetGroup> defaultTargetGroups)
      Default target groups to load balance to.

      All target groups will be load balanced to with equal weight and without stickiness. For a more complex configuration than that, use either defaultAction or addAction().

      Cannot be specified together with defaultAction.

      Default: - None.

      Parameters:
      defaultTargetGroups - Default target groups to load balance to. This parameter is required.
      Returns:
      this
    • protocol

      @Stability(Stable) public NetworkListener.Builder protocol(Protocol protocol)
      Protocol for listener, expects TCP, TLS, UDP, or TCP_UDP.

      Default: - TLS if certificates are provided. TCP otherwise.

      Parameters:
      protocol - Protocol for listener, expects TCP, TLS, UDP, or TCP_UDP. This parameter is required.
      Returns:
      this
    • sslPolicy

      @Stability(Stable) public NetworkListener.Builder sslPolicy(SslPolicy sslPolicy)
      SSL Policy.

      Default: - Current predefined security policy.

      Parameters:
      sslPolicy - SSL Policy. This parameter is required.
      Returns:
      this
    • loadBalancer

      @Stability(Stable) public NetworkListener.Builder loadBalancer(INetworkLoadBalancer loadBalancer)
      The load balancer to attach this listener to.

      Parameters:
      loadBalancer - The load balancer to attach this listener to. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public NetworkListener build()
      Specified by:
      build in interface software.amazon.jsii.Builder<NetworkListener>
      Returns:
      a newly built instance of NetworkListener.