Class CfnLoadBalancer
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.elasticloadbalancingv2.CfnLoadBalancer
- All Implemented Interfaces:
IInspectable,ILoadBalancerRef,IEnvironmentAware,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.121.0 (build d7af9b9)",
date="2025-12-18T18:20:10.320Z")
@Stability(Stable)
public class CfnLoadBalancer
extends CfnResource
implements IInspectable, ILoadBalancerRef, ITaggable
Specifies an Application Load Balancer, a Network Load Balancer, or a Gateway Load Balancer.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.elasticloadbalancingv2.*;
CfnLoadBalancer cfnLoadBalancer = CfnLoadBalancer.Builder.create(this, "MyCfnLoadBalancer")
.enableCapacityReservationProvisionStabilize(false)
.enablePrefixForIpv6SourceNat("enablePrefixForIpv6SourceNat")
.enforceSecurityGroupInboundRulesOnPrivateLinkTraffic("enforceSecurityGroupInboundRulesOnPrivateLinkTraffic")
.ipAddressType("ipAddressType")
.ipv4IpamPoolId("ipv4IpamPoolId")
.loadBalancerAttributes(List.of(LoadBalancerAttributeProperty.builder()
.key("key")
.value("value")
.build()))
.minimumLoadBalancerCapacity(MinimumLoadBalancerCapacityProperty.builder()
.capacityUnits(123)
.build())
.name("name")
.scheme("scheme")
.securityGroups(List.of("securityGroups"))
.subnetMappings(List.of(SubnetMappingProperty.builder()
.subnetId("subnetId")
// the properties below are optional
.allocationId("allocationId")
.iPv6Address("iPv6Address")
.privateIPv4Address("privateIPv4Address")
.sourceNatIpv6Prefix("sourceNatIpv6Prefix")
.build()))
.subnets(List.of("subnets"))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.type("type")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnLoadBalancer.static interfaceSpecifies an attribute for an Application Load Balancer, a Network Load Balancer, or a Gateway Load Balancer.static interfaceThe minimum capacity for a load balancer.static interfaceSpecifies a subnet for a load balancer.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.elasticloadbalancingv2.ILoadBalancerRef
ILoadBalancerRef.Jsii$Default, ILoadBalancerRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnLoadBalancer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnLoadBalancer(software.amazon.jsii.JsiiObjectRef objRef) CfnLoadBalancer(software.constructs.Construct scope, String id) Create a newAWS::ElasticLoadBalancingV2::LoadBalancer.CfnLoadBalancer(software.constructs.Construct scope, String id, CfnLoadBalancerProps props) Create a newAWS::ElasticLoadBalancingV2::LoadBalancer. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForLoadBalancer(ILoadBalancerRef resource) The ID of the Amazon Route 53 hosted zone associated with the load balancer.The DNS name for the load balancer.The Amazon Resource Name (ARN) of the load balancer.The full name of the load balancer.The name of the load balancer.The IDs of the security groups for the load balancer.Indicates whether to enable stabilization when creating or updating an LCU reservation.[Network Load Balancers with UDP listeners] Indicates whether to use an IPv6 prefix from each subnet for source NAT.Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink .The IP address type.The ID of the IPv4 IPAM pool.The load balancer attributes.A reference to a LoadBalancer resource.The minimum capacity for a load balancer.getName()The name of the load balancer.The nodes of an Internet-facing load balancer have public IP addresses.[Application Load Balancers and Network Load Balancers] The IDs of the security groups for the load balancer.The IDs of the subnets.The IDs of the subnets.getTags()Tag Manager which manages the tags for this resource.The tags to assign to the load balancer.getType()The type of load balancer.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnLoadBalancer.renderProperties(Map<String, Object> props) voidIndicates whether to enable stabilization when creating or updating an LCU reservation.voidIndicates whether to enable stabilization when creating or updating an LCU reservation.void[Network Load Balancers with UDP listeners] Indicates whether to use an IPv6 prefix from each subnet for source NAT.voidIndicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink .voidsetIpAddressType(String value) The IP address type.voidsetIpv4IpamPoolId(String value) The ID of the IPv4 IPAM pool.voidsetLoadBalancerAttributes(List<Object> value) The load balancer attributes.voidThe load balancer attributes.voidThe minimum capacity for a load balancer.voidThe minimum capacity for a load balancer.voidThe name of the load balancer.voidThe nodes of an Internet-facing load balancer have public IP addresses.voidsetSecurityGroups(List<String> value) [Application Load Balancers and Network Load Balancers] The IDs of the security groups for the load balancer.voidsetSubnetMappings(List<Object> value) The IDs of the subnets.voidsetSubnetMappings(IResolvable value) The IDs of the subnets.voidsetSubnets(List<String> value) The IDs of the subnets.voidsetTagsRaw(List<CfnTag> value) The tags to assign to the load balancer.voidThe type of load balancer.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnLoadBalancer
protected CfnLoadBalancer(software.amazon.jsii.JsiiObjectRef objRef) -
CfnLoadBalancer
protected CfnLoadBalancer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnLoadBalancer
@Stability(Stable) public CfnLoadBalancer(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnLoadBalancerProps props) Create a newAWS::ElasticLoadBalancingV2::LoadBalancer.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties.
-
CfnLoadBalancer
@Stability(Stable) public CfnLoadBalancer(@NotNull software.constructs.Construct scope, @NotNull String id) Create a newAWS::ElasticLoadBalancingV2::LoadBalancer.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.
-
-
Method Details
-
arnForLoadBalancer
@Stability(Stable) @NotNull public static String arnForLoadBalancer(@NotNull ILoadBalancerRef resource) - Parameters:
resource- This parameter is required.
-
isCfnLoadBalancer
Checks whether the given object is a CfnLoadBalancer.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrCanonicalHostedZoneId
The ID of the Amazon Route 53 hosted zone associated with the load balancer.For example,
Z2P70J7EXAMPLE. -
getAttrDnsName
The DNS name for the load balancer.For example,
my-load-balancer-424835706.us-west-2.elb.amazonaws.com. -
getAttrLoadBalancerArn
The Amazon Resource Name (ARN) of the load balancer. -
getAttrLoadBalancerFullName
The full name of the load balancer.For example,
app/my-load-balancer/50dc6c495c0c9188. -
getAttrLoadBalancerName
The name of the load balancer.For example,
my-load-balancer. -
getAttrSecurityGroups
The IDs of the security groups for the load balancer. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getLoadBalancerRef
A reference to a LoadBalancer resource.- Specified by:
getLoadBalancerRefin interfaceILoadBalancerRef
-
getTags
Tag Manager which manages the tags for this resource. -
getEnableCapacityReservationProvisionStabilize
Indicates whether to enable stabilization when creating or updating an LCU reservation.Returns union: either
BooleanorIResolvable -
setEnableCapacityReservationProvisionStabilize
@Stability(Stable) public void setEnableCapacityReservationProvisionStabilize(@Nullable Boolean value) Indicates whether to enable stabilization when creating or updating an LCU reservation. -
setEnableCapacityReservationProvisionStabilize
@Stability(Stable) public void setEnableCapacityReservationProvisionStabilize(@Nullable IResolvable value) Indicates whether to enable stabilization when creating or updating an LCU reservation. -
getEnablePrefixForIpv6SourceNat
[Network Load Balancers with UDP listeners] Indicates whether to use an IPv6 prefix from each subnet for source NAT. -
setEnablePrefixForIpv6SourceNat
[Network Load Balancers with UDP listeners] Indicates whether to use an IPv6 prefix from each subnet for source NAT. -
getEnforceSecurityGroupInboundRulesOnPrivateLinkTraffic
@Stability(Stable) @Nullable public String getEnforceSecurityGroupInboundRulesOnPrivateLinkTraffic()Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink . -
setEnforceSecurityGroupInboundRulesOnPrivateLinkTraffic
@Stability(Stable) public void setEnforceSecurityGroupInboundRulesOnPrivateLinkTraffic(@Nullable String value) Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink . -
getIpAddressType
The IP address type.Internal load balancers must use
ipv4. -
setIpAddressType
The IP address type.Internal load balancers must use
ipv4. -
getIpv4IpamPoolId
The ID of the IPv4 IPAM pool. -
setIpv4IpamPoolId
The ID of the IPv4 IPAM pool. -
getLoadBalancerAttributes
The load balancer attributes.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnLoadBalancer.LoadBalancerAttributeProperty> -
setLoadBalancerAttributes
The load balancer attributes. -
setLoadBalancerAttributes
The load balancer attributes. -
getMinimumLoadBalancerCapacity
The minimum capacity for a load balancer.Returns union: either
IResolvableorCfnLoadBalancer.MinimumLoadBalancerCapacityProperty -
setMinimumLoadBalancerCapacity
The minimum capacity for a load balancer. -
setMinimumLoadBalancerCapacity
@Stability(Stable) public void setMinimumLoadBalancerCapacity(@Nullable CfnLoadBalancer.MinimumLoadBalancerCapacityProperty value) The minimum capacity for a load balancer. -
getName
The name of the load balancer. -
setName
The name of the load balancer. -
getScheme
The nodes of an Internet-facing load balancer have public IP addresses. -
setScheme
The nodes of an Internet-facing load balancer have public IP addresses. -
getSecurityGroups
[Application Load Balancers and Network Load Balancers] The IDs of the security groups for the load balancer. -
setSecurityGroups
[Application Load Balancers and Network Load Balancers] The IDs of the security groups for the load balancer. -
getSubnetMappings
The IDs of the subnets.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnLoadBalancer.SubnetMappingProperty> -
setSubnetMappings
The IDs of the subnets. -
setSubnetMappings
The IDs of the subnets. -
getSubnets
The IDs of the subnets. -
setSubnets
The IDs of the subnets. -
getTagsRaw
The tags to assign to the load balancer. -
setTagsRaw
The tags to assign to the load balancer. -
getType
The type of load balancer. -
setType
The type of load balancer.
-