Class NetworkListener.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<NetworkListener>
- Enclosing class:
NetworkListener
NetworkListener
.-
Method Summary
Modifier and TypeMethodDescriptionalpnPolicy
(AlpnPolicy alpnPolicy) Application-Layer Protocol Negotiation (ALPN) is a TLS extension that is sent on the initial TLS handshake hello messages.build()
certificates
(List<? extends IListenerCertificate> certificates) Certificate list of ACM cert ARNs.static NetworkListener.Builder
defaultAction
(NetworkListenerAction defaultAction) Default action to take for requests to this listener.defaultTargetGroups
(List<? extends INetworkTargetGroup> defaultTargetGroups) Default target groups to load balance to.loadBalancer
(INetworkLoadBalancer loadBalancer) The load balancer to attach this listener to.The port on which the listener listens for requests.Protocol for listener, expects TCP, TLS, UDP, or TCP_UDP.SSL Policy.
-
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
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
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
oraddAction()
.Cannot be specified together with
defaultAction
.Default: - None.
- Parameters:
defaultTargetGroups
- Default target groups to load balance to. This parameter is required.- Returns:
this
-
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
SSL Policy.Default: - Current predefined security policy.
- Parameters:
sslPolicy
- SSL Policy. This parameter is required.- Returns:
this
-
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
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<NetworkListener>
-