Class CfnLoadBalancer
- All Implemented Interfaces:
- IInspectable,- ITaggable,- ILoadBalancerRef,- software.amazon.jsii.JsiiSerializable,- software.constructs.IConstruct,- software.constructs.IDependable
If this resource has a public IP address and is also in a VPC that is defined in the same template, you must use the DependsOn attribute to declare a dependency on the VPC-gateway attachment.
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.elasticloadbalancing.*;
 Object attributes;
 CfnLoadBalancer cfnLoadBalancer = CfnLoadBalancer.Builder.create(this, "MyCfnLoadBalancer")
         .listeners(List.of(ListenersProperty.builder()
                 .instancePort("instancePort")
                 .loadBalancerPort("loadBalancerPort")
                 .protocol("protocol")
                 // the properties below are optional
                 .instanceProtocol("instanceProtocol")
                 .policyNames(List.of("policyNames"))
                 .sslCertificateId("sslCertificateId")
                 .build()))
         // the properties below are optional
         .accessLoggingPolicy(AccessLoggingPolicyProperty.builder()
                 .enabled(false)
                 .s3BucketName("s3BucketName")
                 // the properties below are optional
                 .emitInterval(123)
                 .s3BucketPrefix("s3BucketPrefix")
                 .build())
         .appCookieStickinessPolicy(List.of(AppCookieStickinessPolicyProperty.builder()
                 .cookieName("cookieName")
                 .policyName("policyName")
                 .build()))
         .availabilityZones(List.of("availabilityZones"))
         .connectionDrainingPolicy(ConnectionDrainingPolicyProperty.builder()
                 .enabled(false)
                 // the properties below are optional
                 .timeout(123)
                 .build())
         .connectionSettings(ConnectionSettingsProperty.builder()
                 .idleTimeout(123)
                 .build())
         .crossZone(false)
         .healthCheck(HealthCheckProperty.builder()
                 .healthyThreshold("healthyThreshold")
                 .interval("interval")
                 .target("target")
                 .timeout("timeout")
                 .unhealthyThreshold("unhealthyThreshold")
                 .build())
         .instances(List.of("instances"))
         .lbCookieStickinessPolicy(List.of(LBCookieStickinessPolicyProperty.builder()
                 .cookieExpirationPeriod("cookieExpirationPeriod")
                 .policyName("policyName")
                 .build()))
         .loadBalancerName("loadBalancerName")
         .policies(List.of(PoliciesProperty.builder()
                 .attributes(List.of(attributes))
                 .policyName("policyName")
                 .policyType("policyType")
                 // the properties below are optional
                 .instancePorts(List.of("instancePorts"))
                 .loadBalancerPorts(List.of("loadBalancerPorts"))
                 .build()))
         .scheme("scheme")
         .securityGroups(List.of("securityGroups"))
         .subnets(List.of("subnets"))
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 - See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceSpecifies where and how access logs are stored for your Classic Load Balancer.static interfaceSpecifies a policy for application-controlled session stickiness for your Classic Load Balancer.static final classA fluent builder forCfnLoadBalancer.static interfaceSpecifies the connection draining settings for your Classic Load Balancer.static interfaceSpecifies the idle timeout value for your Classic Load Balancer.static interfaceSpecifies health check settings for your Classic Load Balancer.static interfaceSpecifies a policy for duration-based session stickiness for your Classic Load Balancer.static interfaceSpecifies a listener for your Classic Load Balancer.static interfaceSpecifies policies for your Classic Load Balancer.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObjectsoftware.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstructsoftware.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectableIInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancing.ILoadBalancerRefILoadBalancerRef.Jsii$Default, ILoadBalancerRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableITaggable.Jsii$Default, ITaggable.Jsii$Proxy
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedCfnLoadBalancer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnLoadBalancer(software.amazon.jsii.JsiiObjectRef objRef) CfnLoadBalancer(software.constructs.Construct scope, String id, CfnLoadBalancerProps props) 
- 
Method SummaryModifier and TypeMethodDescriptionInformation about where and how access logs are stored for the load balancer.Information about a policy for application-controlled session stickiness.The name of the Route 53 hosted zone that is associated with the load balancer.The ID of the Route 53 hosted zone name that is associated with the load balancer.The DNS name for the load balancer.The name of the security group that you can use as part of your inbound rules for your load balancer's back-end instances.The owner of the source security group.The Availability Zones for a load balancer in a default VPC.If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance.If enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration.If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones.The health check settings to use when evaluating the health of your EC2 instances.The IDs of the instances for the load balancer.Information about a policy for duration-based session stickiness.The listeners for the load balancer.The name of the load balancer.A reference to a LoadBalancer resource.The policies defined for your Classic Load Balancer.The type of load balancer.The security groups for the load balancer.The IDs of the subnets for the load balancer.getTags()Tag Manager which manages the tags for this resource.The tags associated with a load balancer.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidInformation about where and how access logs are stored for the load balancer.voidInformation about where and how access logs are stored for the load balancer.voidsetAppCookieStickinessPolicy(List<Object> value) Information about a policy for application-controlled session stickiness.voidInformation about a policy for application-controlled session stickiness.voidsetAvailabilityZones(List<String> value) The Availability Zones for a load balancer in a default VPC.voidIf enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance.voidIf enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance.voidsetConnectionSettings(IResolvable value) If enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration.voidIf enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration.voidsetCrossZone(Boolean value) If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones.voidsetCrossZone(IResolvable value) If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones.voidsetHealthCheck(IResolvable value) The health check settings to use when evaluating the health of your EC2 instances.voidThe health check settings to use when evaluating the health of your EC2 instances.voidsetInstances(List<String> value) The IDs of the instances for the load balancer.voidsetLbCookieStickinessPolicy(List<Object> value) Information about a policy for duration-based session stickiness.voidInformation about a policy for duration-based session stickiness.voidsetListeners(List<Object> value) The listeners for the load balancer.voidsetListeners(IResolvable value) The listeners for the load balancer.voidsetLoadBalancerName(String value) The name of the load balancer.voidsetPolicies(List<Object> value) The policies defined for your Classic Load Balancer.voidsetPolicies(IResolvable value) The policies defined for your Classic Load Balancer.voidThe type of load balancer.voidsetSecurityGroups(List<String> value) The security groups for the load balancer.voidsetSubnets(List<String> value) The IDs of the subnets for the load balancer.voidsetTagsRaw(List<CfnTag> value) The tags associated with a load balancer.Methods inherited from class software.amazon.awscdk.CfnResourceaddDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElementgetRefMethods inherited from class software.amazon.awscdk.CfnElementgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.ConstructgetNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObjectjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstructgetNodeMethods inherited from interface software.amazon.jsii.JsiiSerializable$jsii$toJson
- 
Field Details- 
CFN_RESOURCE_TYPE_NAMEThe CloudFormation resource type name for this resource class.
 
- 
- 
Constructor Details- 
CfnLoadBalancerprotected CfnLoadBalancer(software.amazon.jsii.JsiiObjectRef objRef) 
- 
CfnLoadBalancerprotected CfnLoadBalancer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) 
- 
CfnLoadBalancer@Stability(Stable) public CfnLoadBalancer(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnLoadBalancerProps props) - 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. This parameter is required.
 
 
- 
- 
Method Details- 
inspectExamines the CloudFormation resource and discloses attributes.- Specified by:
- inspectin interface- IInspectable
- 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 class- CfnResource
- Parameters:
- props- This parameter is required.
 
- 
getAttrCanonicalHostedZoneNameThe name of the Route 53 hosted zone that is associated with the load balancer.Internal-facing load balancers don't use this value, use DNSNameinstead.
- 
getAttrCanonicalHostedZoneNameIdThe ID of the Route 53 hosted zone name that is associated with the load balancer.
- 
getAttrDnsNameThe DNS name for the load balancer.
- 
getAttrId
- 
getAttrSourceSecurityGroupGroupNameThe name of the security group that you can use as part of your inbound rules for your load balancer's back-end instances.
- 
getAttrSourceSecurityGroupOwnerAliasThe owner of the source security group.
- 
getCfnProperties- Overrides:
- getCfnPropertiesin class- CfnResource
 
- 
getLoadBalancerRefA reference to a LoadBalancer resource.- Specified by:
- getLoadBalancerRefin interface- ILoadBalancerRef
 
- 
getTagsTag Manager which manages the tags for this resource.
- 
getListenersThe listeners for the load balancer.You can specify at most one listener per port. Returns union: either IResolvableor Listinvalid input: '<'eitherIResolvableorCfnLoadBalancer.ListenersProperty>
- 
setListenersThe listeners for the load balancer.You can specify at most one listener per port. 
- 
setListenersThe listeners for the load balancer.You can specify at most one listener per port. 
- 
getAccessLoggingPolicyInformation about where and how access logs are stored for the load balancer.Returns union: either IResolvableorCfnLoadBalancer.AccessLoggingPolicyProperty
- 
setAccessLoggingPolicyInformation about where and how access logs are stored for the load balancer.
- 
setAccessLoggingPolicy@Stability(Stable) public void setAccessLoggingPolicy(@Nullable CfnLoadBalancer.AccessLoggingPolicyProperty value) Information about where and how access logs are stored for the load balancer.
- 
getAppCookieStickinessPolicyInformation about a policy for application-controlled session stickiness.Returns union: either IResolvableor Listinvalid input: '<'eitherIResolvableorCfnLoadBalancer.AppCookieStickinessPolicyProperty>
- 
setAppCookieStickinessPolicyInformation about a policy for application-controlled session stickiness.
- 
setAppCookieStickinessPolicyInformation about a policy for application-controlled session stickiness.
- 
getAvailabilityZonesThe Availability Zones for a load balancer in a default VPC.
- 
setAvailabilityZonesThe Availability Zones for a load balancer in a default VPC.
- 
getConnectionDrainingPolicyIf enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance.Returns union: either IResolvableorCfnLoadBalancer.ConnectionDrainingPolicyProperty
- 
setConnectionDrainingPolicyIf enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance.
- 
setConnectionDrainingPolicy@Stability(Stable) public void setConnectionDrainingPolicy(@Nullable CfnLoadBalancer.ConnectionDrainingPolicyProperty value) If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance.
- 
getConnectionSettingsIf enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration.Returns union: either IResolvableorCfnLoadBalancer.ConnectionSettingsProperty
- 
setConnectionSettingsIf enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration.
- 
setConnectionSettings@Stability(Stable) public void setConnectionSettings(@Nullable CfnLoadBalancer.ConnectionSettingsProperty value) If enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration.
- 
getCrossZoneIf enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones.Returns union: either BooleanorIResolvable
- 
setCrossZoneIf enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones.
- 
setCrossZoneIf enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones.
- 
getHealthCheckThe health check settings to use when evaluating the health of your EC2 instances.Returns union: either IResolvableorCfnLoadBalancer.HealthCheckProperty
- 
setHealthCheckThe health check settings to use when evaluating the health of your EC2 instances.
- 
setHealthCheckThe health check settings to use when evaluating the health of your EC2 instances.
- 
getInstancesThe IDs of the instances for the load balancer.
- 
setInstancesThe IDs of the instances for the load balancer.
- 
getLbCookieStickinessPolicyInformation about a policy for duration-based session stickiness.Returns union: either IResolvableor Listinvalid input: '<'eitherIResolvableorCfnLoadBalancer.LBCookieStickinessPolicyProperty>
- 
setLbCookieStickinessPolicyInformation about a policy for duration-based session stickiness.
- 
setLbCookieStickinessPolicyInformation about a policy for duration-based session stickiness.
- 
getLoadBalancerNameThe name of the load balancer.
- 
setLoadBalancerNameThe name of the load balancer.
- 
getPoliciesThe policies defined for your Classic Load Balancer.Returns union: either IResolvableor Listinvalid input: '<'eitherIResolvableorCfnLoadBalancer.PoliciesProperty>
- 
setPoliciesThe policies defined for your Classic Load Balancer.
- 
setPoliciesThe policies defined for your Classic Load Balancer.
- 
getSchemeThe type of load balancer.Valid only for load balancers in a VPC. 
- 
setSchemeThe type of load balancer.Valid only for load balancers in a VPC. 
- 
getSecurityGroupsThe security groups for the load balancer.
- 
setSecurityGroupsThe security groups for the load balancer.
- 
getSubnetsThe IDs of the subnets for the load balancer.You can specify at most one subnet per Availability Zone. 
- 
setSubnetsThe IDs of the subnets for the load balancer.You can specify at most one subnet per Availability Zone. 
- 
getTagsRawThe tags associated with a load balancer.
- 
setTagsRawThe tags associated with a load balancer.
 
-