Interface NetworkLoadBalancerAttributes
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
NetworkLoadBalancerAttributes.Jsii$Proxy
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-10-31T19:12:58.170Z")
@Stability(Stable)
public interface NetworkLoadBalancerAttributes
extends software.amazon.jsii.JsiiSerializable
Properties to reference an existing load balancer.
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
Modifier and TypeInterfaceDescriptionstatic final class
A builder forNetworkLoadBalancerAttributes
static final class
An implementation forNetworkLoadBalancerAttributes
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
ARN of the load balancer.default String
The canonical hosted zone ID of this load balancer.default String
The DNS name of this load balancer.Security groups to associate with this load balancer.default IVpc
getVpc()
The VPC to associate with the load balancer.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getLoadBalancerArn
ARN of the load balancer. -
getLoadBalancerCanonicalHostedZoneId
The canonical hosted zone ID of this load balancer.Default: - When not provided, LB cannot be used as Route53 Alias target.
-
getLoadBalancerDnsName
The DNS name of this load balancer.Default: - When not provided, LB cannot be used as Route53 Alias target.
-
getLoadBalancerSecurityGroups
Security groups to associate with this load balancer.Default: - No security groups associated with the load balancer.
-
getVpc
The VPC to associate with the load balancer.Default: - When not provided, listeners cannot be created on imported load balancers.
-
builder
-