@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.518Z") @Stability(value=Stable) public interface ListenerOptions extends software.amazon.jsii.JsiiSerializable
Example:
// Create an Accelerator
Accelerator accelerator = new Accelerator(this, "Accelerator");
// Create a Listener
Listener listener = accelerator.addListener("Listener", ListenerOptions.builder()
.portRanges(List.of(PortRange.builder().fromPort(80).build(), PortRange.builder().fromPort(443).build()))
.build());
// Import the Load Balancers
INetworkLoadBalancer nlb1 = NetworkLoadBalancer.fromNetworkLoadBalancerAttributes(this, "NLB1", NetworkLoadBalancerAttributes.builder()
.loadBalancerArn("arn:aws:elasticloadbalancing:us-west-2:111111111111:loadbalancer/app/my-load-balancer1/e16bef66805b")
.build());
INetworkLoadBalancer nlb2 = NetworkLoadBalancer.fromNetworkLoadBalancerAttributes(this, "NLB2", NetworkLoadBalancerAttributes.builder()
.loadBalancerArn("arn:aws:elasticloadbalancing:ap-south-1:111111111111:loadbalancer/app/my-load-balancer2/5513dc2ea8a1")
.build());
// Add one EndpointGroup for each Region we are targeting
listener.addEndpointGroup("Group1", EndpointGroupOptions.builder()
.endpoints(List.of(new NetworkLoadBalancerEndpoint(nlb1)))
.build());
listener.addEndpointGroup("Group2", EndpointGroupOptions.builder()
// Imported load balancers automatically calculate their Region from the ARN.
// If you are load balancing to other resources, you must also pass a `region`
// parameter here.
.endpoints(List.of(new NetworkLoadBalancerEndpoint(nlb2)))
.build());
| Modifier and Type | Interface and Description |
|---|---|
static class |
ListenerOptions.Builder
A builder for
ListenerOptions |
static class |
ListenerOptions.Jsii$Proxy
An implementation for
ListenerOptions |
| Modifier and Type | Method and Description |
|---|---|
static ListenerOptions.Builder |
builder() |
default ClientAffinity |
getClientAffinity()
Client affinity to direct all requests from a user to the same endpoint.
|
default String |
getListenerName()
Name of the listener.
|
List<PortRange> |
getPortRanges()
The list of port ranges for the connections from clients to the accelerator.
|
default ConnectionProtocol |
getProtocol()
The protocol for the connections from clients to the accelerator.
|
@Stability(value=Stable) @NotNull List<PortRange> getPortRanges()
@Stability(value=Stable) @Nullable default ClientAffinity getClientAffinity()
If you have stateful applications, client affinity lets you direct all requests from a user to the same endpoint.
By default, each connection from each client is routed to seperate endpoints. Set client affinity to SOURCE_IP to route all connections from a single client to the same endpoint.
Default: ClientAffinity.NONE
@Stability(value=Stable) @Nullable default String getListenerName()
Default: - logical ID of the resource
@Stability(value=Stable) @Nullable default ConnectionProtocol getProtocol()
Default: ConnectionProtocol.TCP
@Stability(value=Stable) static ListenerOptions.Builder builder()
ListenerOptions.Builder of ListenerOptionsCopyright © 2022. All rights reserved.