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.101.0 (build b95fe5d)", date="2024-07-12T19:34:02.589Z") @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());
 
  • 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

      @Stability(Stable) public NetworkLoadBalancerEndpoint(@NotNull INetworkLoadBalancer loadBalancer)
      Parameters:
      loadBalancer - This parameter is required.
  • Method Details

    • renderEndpointConfiguration

      @Stability(Stable) @NotNull public Object renderEndpointConfiguration()
      Render the endpoint to an endpoint configuration.
      Specified by:
      renderEndpointConfiguration in interface IEndpoint
    • getRegion

      @Stability(Stable) @Nullable public String getRegion()
      The region where the endpoint is located.

      If the region cannot be determined, undefined is returned

      Specified by:
      getRegion in interface IEndpoint