Class ApplicationListener.Builder

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

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

    • create

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

      @Stability(Stable) public ApplicationListener.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 ApplicationListener.Builder defaultAction(ListenerAction defaultAction)
      Default action to take for requests to this listener.

      This allows full control of the default action of the load balancer, including Action chaining, fixed responses and redirect responses.

      See the ListenerAction 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 ApplicationListener.Builder defaultTargetGroups(List<? extends IApplicationTargetGroup> 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
    • open

      @Stability(Stable) public ApplicationListener.Builder open(Boolean open)
      Allow anyone to connect to the load balancer on the listener port.

      If this is specified, the load balancer will be opened up to anyone who can reach it. For internal load balancers this is anyone in the same VPC. For public load balancers, this is anyone on the internet.

      If you want to be more selective about who can access this load balancer, set this to false and use the listener's connections object to selectively grant access to the load balancer on the listener port.

      Default: true

      Parameters:
      open - Allow anyone to connect to the load balancer on the listener port. This parameter is required.
      Returns:
      this
    • port

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

      Default: - Determined from protocol if known.

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

      @Stability(Stable) public ApplicationListener.Builder protocol(ApplicationProtocol protocol)
      The protocol to use.

      Default: - Determined from port if known.

      Parameters:
      protocol - The protocol to use. This parameter is required.
      Returns:
      this
    • sslPolicy

      @Stability(Stable) public ApplicationListener.Builder sslPolicy(SslPolicy sslPolicy)
      The security policy that defines which ciphers and protocols are supported.

      Default: - The current predefined security policy.

      Parameters:
      sslPolicy - The security policy that defines which ciphers and protocols are supported. This parameter is required.
      Returns:
      this
    • loadBalancer

      @Stability(Stable) public ApplicationListener.Builder loadBalancer(IApplicationLoadBalancer 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 ApplicationListener build()
      Specified by:
      build in interface software.amazon.jsii.Builder<ApplicationListener>
      Returns:
      a newly built instance of ApplicationListener.