aws-cdk-lib.aws_globalaccelerator_endpoints.NetworkLoadBalancerEndpoint

class NetworkLoadBalancerEndpoint

LanguageType name
.NETAmazon.CDK.AWS.GlobalAccelerator.Endpoints.NetworkLoadBalancerEndpoint
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsglobalacceleratorendpoints#NetworkLoadBalancerEndpoint
Javasoftware.amazon.awscdk.services.globalaccelerator.endpoints.NetworkLoadBalancerEndpoint
Pythonaws_cdk.aws_globalaccelerator_endpoints.NetworkLoadBalancerEndpoint
TypeScript (source)aws-cdk-lib » aws_globalaccelerator_endpoints » NetworkLoadBalancerEndpoint

Implements IEndpoint

Use a Network Load Balancer as a Global Accelerator Endpoint.

Example

// Create an Accelerator
const accelerator = new globalaccelerator.Accelerator(this, 'Accelerator');

// Create a Listener
const listener = accelerator.addListener('Listener', {
  portRanges: [
    { fromPort: 80 },
    { fromPort: 443 },
  ],
});

// Import the Load Balancers
const nlb1 = elbv2.NetworkLoadBalancer.fromNetworkLoadBalancerAttributes(this, 'NLB1', {
  loadBalancerArn: 'arn:aws:elasticloadbalancing:us-west-2:111111111111:loadbalancer/app/my-load-balancer1/e16bef66805b',
});
const nlb2 = elbv2.NetworkLoadBalancer.fromNetworkLoadBalancerAttributes(this, 'NLB2', {
  loadBalancerArn: 'arn:aws:elasticloadbalancing:ap-south-1:111111111111:loadbalancer/app/my-load-balancer2/5513dc2ea8a1',
});

// Add one EndpointGroup for each Region we are targeting
listener.addEndpointGroup('Group1', {
  endpoints: [new ga_endpoints.NetworkLoadBalancerEndpoint(nlb1)],
});
listener.addEndpointGroup('Group2', {
  // 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: [new ga_endpoints.NetworkLoadBalancerEndpoint(nlb2)],
});

Initializer

new NetworkLoadBalancerEndpoint(loadBalancer: INetworkLoadBalancer, options?: NetworkLoadBalancerEndpointProps)

Parameters

  • loadBalancer INetworkLoadBalancer
  • options NetworkLoadBalancerEndpointProps

Properties

NameTypeDescription
region?stringThe region where the endpoint is located.

region?

Type: string (optional)

The region where the endpoint is located.

If the region cannot be determined, undefined is returned

Methods

NameDescription
renderEndpointConfiguration()Render the endpoint to an endpoint configuration.

renderEndpointConfiguration()

public renderEndpointConfiguration(): any

Returns

  • any

Render the endpoint to an endpoint configuration.