Class NetworkLoadBalancerEndpoint
Use a Network Load Balancer as a Global Accelerator Endpoint.
Inheritance
System.Object
NetworkLoadBalancerEndpoint
Implements
Namespace: Amazon.CDK.AWS.GlobalAccelerator.Endpoints
Assembly: Amazon.CDK.AWS.GlobalAccelerator.Endpoints.dll
Syntax (csharp)
public class NetworkLoadBalancerEndpoint : DeputyBase, IEndpoint
Syntax (vb)
Public Class NetworkLoadBalancerEndpoint
Inherits DeputyBase
Implements IEndpoint
Remarks
ExampleMetadata: infused
Examples
// Create an Accelerator
var accelerator = new Accelerator(this, "Accelerator");
// Create a Listener
var listener = accelerator.AddListener("Listener", new ListenerOptions {
PortRanges = new [] { new PortRange { FromPort = 80 }, new PortRange { FromPort = 443 } }
});
// Import the Load Balancers
var nlb1 = NetworkLoadBalancer.FromNetworkLoadBalancerAttributes(this, "NLB1", new NetworkLoadBalancerAttributes {
LoadBalancerArn = "arn:aws:elasticloadbalancing:us-west-2:111111111111:loadbalancer/app/my-load-balancer1/e16bef66805b"
});
var nlb2 = NetworkLoadBalancer.FromNetworkLoadBalancerAttributes(this, "NLB2", new NetworkLoadBalancerAttributes {
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", new EndpointGroupOptions {
Endpoints = new [] { new NetworkLoadBalancerEndpoint(nlb1) }
});
listener.AddEndpointGroup("Group2", new EndpointGroupOptions {
// 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 [] { new NetworkLoadBalancerEndpoint(nlb2) }
});
Synopsis
Constructors
NetworkLoadBalancerEndpoint(INetworkLoadBalancer, INetworkLoadBalancerEndpointProps) | |
NetworkLoadBalancerEndpoint(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
NetworkLoadBalancerEndpoint(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
Region | The region where the endpoint is located. |
Methods
RenderEndpointConfiguration() | Render the endpoint to an endpoint configuration. |
Constructors
NetworkLoadBalancerEndpoint(INetworkLoadBalancer, INetworkLoadBalancerEndpointProps)
public NetworkLoadBalancerEndpoint(INetworkLoadBalancer loadBalancer, INetworkLoadBalancerEndpointProps options = null)
Parameters
- loadBalancer INetworkLoadBalancer
- options INetworkLoadBalancerEndpointProps
NetworkLoadBalancerEndpoint(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected NetworkLoadBalancerEndpoint(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
NetworkLoadBalancerEndpoint(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected NetworkLoadBalancerEndpoint(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
Region
The region where the endpoint is located.
public virtual string Region { get; }
Property Value
System.String
Remarks
If the region cannot be determined, undefined
is returned
Methods
RenderEndpointConfiguration()
Render the endpoint to an endpoint configuration.
public virtual object RenderEndpointConfiguration()
Returns
System.Object