@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)",
date="2023-03-28T21:34:27.355Z")
public interface ListenerOptions
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 java.lang.String |
getListenerName()
Name of the listener.
|
java.util.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.
|
java.util.List<PortRange> getPortRanges()
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
default java.lang.String getListenerName()
Default: - logical ID of the resource
default ConnectionProtocol getProtocol()
Default: ConnectionProtocol.TCP
static ListenerOptions.Builder builder()
ListenerOptions.Builder
of ListenerOptions