interface NetworkLoadBalancerAttributes
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ElasticLoadBalancingV2.NetworkLoadBalancerAttributes |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awselasticloadbalancingv2#NetworkLoadBalancerAttributes |
![]() | software.amazon.awscdk.services.elasticloadbalancingv2.NetworkLoadBalancerAttributes |
![]() | aws_cdk.aws_elasticloadbalancingv2.NetworkLoadBalancerAttributes |
![]() | aws-cdk-lib » aws_elasticloadbalancingv2 » NetworkLoadBalancerAttributes |
Properties to reference an existing load balancer.
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)],
});
Properties
Name | Type | Description |
---|---|---|
load | string | ARN of the load balancer. |
load | string | The canonical hosted zone ID of this load balancer. |
load | string | The DNS name of this load balancer. |
load | string[] | Security groups to associate with this load balancer. |
vpc? | IVpc | The VPC to associate with the load balancer. |
loadBalancerArn
Type:
string
ARN of the load balancer.
loadBalancerCanonicalHostedZoneId?
Type:
string
(optional, default: When not provided, LB cannot be used as Route53 Alias target.)
The canonical hosted zone ID of this load balancer.
loadBalancerDnsName?
Type:
string
(optional, default: When not provided, LB cannot be used as Route53 Alias target.)
The DNS name of this load balancer.
loadBalancerSecurityGroups?
Type:
string[]
(optional, default: No security groups associated with the load balancer.)
Security groups to associate with this load balancer.
vpc?
Type:
IVpc
(optional, default: When not provided, listeners cannot be created on imported load
balancers.)
The VPC to associate with the load balancer.