Class NetworkLoadBalancerEndpoint
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.globalaccelerator.endpoints.NetworkLoadBalancerEndpoint
- All Implemented Interfaces:
IEndpoint,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:46.792Z")
@Stability(Stable)
public class NetworkLoadBalancerEndpoint
extends software.amazon.jsii.JsiiObject
implements IEndpoint
Use a Network Load Balancer as a Global Accelerator Endpoint.
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());
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forNetworkLoadBalancerEndpoint.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.globalaccelerator.IEndpoint
IEndpoint.Jsii$Default, IEndpoint.Jsii$Proxy -
Constructor Summary
ConstructorsModifierConstructorDescriptionNetworkLoadBalancerEndpoint(INetworkLoadBalancer loadBalancer) NetworkLoadBalancerEndpoint(INetworkLoadBalancer loadBalancer, NetworkLoadBalancerEndpointProps options) protectedNetworkLoadBalancerEndpoint(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedNetworkLoadBalancerEndpoint(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe region where the endpoint is located.Render the endpoint to an endpoint configuration.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
NetworkLoadBalancerEndpoint
protected NetworkLoadBalancerEndpoint(software.amazon.jsii.JsiiObjectRef objRef) -
NetworkLoadBalancerEndpoint
protected NetworkLoadBalancerEndpoint(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
NetworkLoadBalancerEndpoint
@Stability(Stable) public NetworkLoadBalancerEndpoint(@NotNull INetworkLoadBalancer loadBalancer, @Nullable NetworkLoadBalancerEndpointProps options) - Parameters:
loadBalancer- This parameter is required.options-
-
NetworkLoadBalancerEndpoint
- Parameters:
loadBalancer- This parameter is required.
-
-
Method Details
-
renderEndpointConfiguration
Render the endpoint to an endpoint configuration.- Specified by:
renderEndpointConfigurationin interfaceIEndpoint
-
getRegion
The region where the endpoint is located.If the region cannot be determined,
undefinedis returned
-