Interface BaseNetworkListenerProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
NetworkListenerProps
- All Known Implementing Classes:
BaseNetworkListenerProps.Jsii$Proxy,NetworkListenerProps.Jsii$Proxy
Example:
Vpc vpc;
AutoScalingGroup asg;
ISecurityGroup sg1;
ISecurityGroup sg2;
// Create the load balancer in a VPC. 'internetFacing' is 'false'
// by default, which creates an internal load balancer.
NetworkLoadBalancer lb = NetworkLoadBalancer.Builder.create(this, "LB")
.vpc(vpc)
.internetFacing(true)
.securityGroups(List.of(sg1))
.build();
lb.addSecurityGroup(sg2);
// Add a listener on a particular port.
NetworkListener listener = lb.addListener("Listener", BaseNetworkListenerProps.builder()
.port(443)
.build());
// Add targets on a particular port.
listener.addTargets("AppFleet", AddNetworkTargetsProps.builder()
.port(443)
.targets(List.of(asg))
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forBaseNetworkListenerPropsstatic final classAn implementation forBaseNetworkListenerProps -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default AlpnPolicyApplication-Layer Protocol Negotiation (ALPN) is a TLS extension that is sent on the initial TLS handshake hello messages.default List<IListenerCertificate>Certificate list of ACM cert ARNs.default NetworkListenerActionDefault action to take for requests to this listener.default List<INetworkTargetGroup>Default target groups to load balance to.getPort()The port on which the listener listens for requests.default ProtocolProtocol for listener, expects TCP, TLS, UDP, or TCP_UDP.default SslPolicySSL Policy.default DurationThe load balancer TCP idle timeout.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getPort
The port on which the listener listens for requests. -
getAlpnPolicy
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
-
getCertificates
Certificate list of ACM cert ARNs.You must provide exactly one certificate if the listener protocol is HTTPS or TLS.
Default: - No certificates.
-
getDefaultAction
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
NetworkListenerActionclass for all options.Cannot be specified together with
defaultTargetGroups.Default: - None.
-
getDefaultTargetGroups
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
defaultActionoraddAction().Cannot be specified together with
defaultAction.Default: - None.
-
getProtocol
Protocol for listener, expects TCP, TLS, UDP, or TCP_UDP.Default: - TLS if certificates are provided. TCP otherwise.
-
getSslPolicy
SSL Policy.Default: - Current predefined security policy.
-
getTcpIdleTimeout
The load balancer TCP idle timeout.Default: Duration.seconds(350)
-
builder
- Returns:
- a
BaseNetworkListenerProps.BuilderofBaseNetworkListenerProps
-