@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.026Z") @Stability(value=Stable) public class CfnLoadBalancer extends CfnResource implements IInspectable
Specifies a Classic Load Balancer.
You can specify the AvailabilityZones or Subnets property, but not both.
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();
| Modifier and Type | Class and Description |
|---|---|
static interface |
CfnLoadBalancer.AccessLoggingPolicyProperty
Specifies where and how access logs are stored for your Classic Load Balancer.
|
static interface |
CfnLoadBalancer.AppCookieStickinessPolicyProperty
Specifies a policy for application-controlled session stickiness for your Classic Load Balancer.
|
static class |
CfnLoadBalancer.Builder
A fluent builder for
CfnLoadBalancer. |
static interface |
CfnLoadBalancer.ConnectionDrainingPolicyProperty
Specifies the connection draining settings for your Classic Load Balancer.
|
static interface |
CfnLoadBalancer.ConnectionSettingsProperty
Specifies the idle timeout value for your Classic Load Balancer.
|
static interface |
CfnLoadBalancer.HealthCheckProperty
Specifies health check settings for your Classic Load Balancer.
|
static interface |
CfnLoadBalancer.LBCookieStickinessPolicyProperty
Specifies a policy for duration-based session stickiness for your Classic Load Balancer.
|
static interface |
CfnLoadBalancer.ListenersProperty
Specifies a listener for your Classic Load Balancer.
|
static interface |
CfnLoadBalancer.PoliciesProperty
Specifies policies for your Classic Load Balancer.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnLoadBalancer(software.constructs.Construct scope,
String id,
CfnLoadBalancerProps props)
Create a new `AWS::ElasticLoadBalancing::LoadBalancer`.
|
protected |
CfnLoadBalancer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnLoadBalancer(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAccessLoggingPolicy()
Information about where and how access logs are stored for the load balancer.
|
Object |
getAppCookieStickinessPolicy()
Information about a policy for application-controlled session stickiness.
|
String |
getAttrCanonicalHostedZoneName()
The name of the Route 53 hosted zone that is associated with the load balancer.
|
String |
getAttrCanonicalHostedZoneNameId()
The ID of the Route 53 hosted zone name that is associated with the load balancer.
|
String |
getAttrDnsName()
The DNS name for the load balancer.
|
String |
getAttrSourceSecurityGroupGroupName()
The name of the security group that you can use as part of your inbound rules for your load balancer's back-end instances.
|
String |
getAttrSourceSecurityGroupOwnerAlias()
The owner of the source security group.
|
List<String> |
getAvailabilityZones()
The Availability Zones for the load balancer.
|
protected Map<String,Object> |
getCfnProperties() |
Object |
getConnectionDrainingPolicy()
If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance.
|
Object |
getConnectionSettings()
If enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration.
|
Object |
getCrossZone()
If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones.
|
Object |
getHealthCheck()
The health check settings to use when evaluating the health of your EC2 instances.
|
List<String> |
getInstances()
The IDs of the instances for the load balancer.
|
Object |
getLbCookieStickinessPolicy()
Information about a policy for duration-based session stickiness.
|
Object |
getListeners()
The listeners for the load balancer.
|
String |
getLoadBalancerName()
The name of the load balancer.
|
Object |
getPolicies()
The policies defined for your Classic Load Balancer.
|
String |
getScheme()
The type of load balancer.
|
List<String> |
getSecurityGroups()
The security groups for the load balancer.
|
List<String> |
getSubnets()
The IDs of the subnets for the load balancer.
|
TagManager |
getTags()
The tags associated with a load balancer.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setAccessLoggingPolicy(CfnLoadBalancer.AccessLoggingPolicyProperty value)
Information about where and how access logs are stored for the load balancer.
|
void |
setAccessLoggingPolicy(IResolvable value)
Information about where and how access logs are stored for the load balancer.
|
void |
setAppCookieStickinessPolicy(IResolvable value)
Information about a policy for application-controlled session stickiness.
|
void |
setAppCookieStickinessPolicy(List<Object> value)
Information about a policy for application-controlled session stickiness.
|
void |
setAvailabilityZones(List<String> value)
The Availability Zones for the load balancer.
|
void |
setConnectionDrainingPolicy(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.
|
void |
setConnectionDrainingPolicy(IResolvable value)
If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance.
|
void |
setConnectionSettings(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.
|
void |
setConnectionSettings(IResolvable value)
If enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration.
|
void |
setCrossZone(Boolean value)
If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones.
|
void |
setCrossZone(IResolvable value)
If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones.
|
void |
setHealthCheck(CfnLoadBalancer.HealthCheckProperty value)
The health check settings to use when evaluating the health of your EC2 instances.
|
void |
setHealthCheck(IResolvable value)
The health check settings to use when evaluating the health of your EC2 instances.
|
void |
setInstances(List<String> value)
The IDs of the instances for the load balancer.
|
void |
setLbCookieStickinessPolicy(IResolvable value)
Information about a policy for duration-based session stickiness.
|
void |
setLbCookieStickinessPolicy(List<Object> value)
Information about a policy for duration-based session stickiness.
|
void |
setListeners(IResolvable value)
The listeners for the load balancer.
|
void |
setListeners(List<Object> value)
The listeners for the load balancer.
|
void |
setLoadBalancerName(String value)
The name of the load balancer.
|
void |
setPolicies(IResolvable value)
The policies defined for your Classic Load Balancer.
|
void |
setPolicies(List<Object> value)
The policies defined for your Classic Load Balancer.
|
void |
setScheme(String value)
The type of load balancer.
|
void |
setSecurityGroups(List<String> value)
The security groups for the load balancer.
|
void |
setSubnets(List<String> value)
The IDs of the subnets for the load balancer.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnLoadBalancer(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnLoadBalancer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnLoadBalancer(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnLoadBalancerProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrCanonicalHostedZoneName()
Internal-facing load balancers don't use this value, use DNSName instead.
@Stability(value=Stable) @NotNull public String getAttrCanonicalHostedZoneNameId()
@Stability(value=Stable) @NotNull public String getAttrDnsName()
@Stability(value=Stable) @NotNull public String getAttrSourceSecurityGroupGroupName()
@Stability(value=Stable) @NotNull public String getAttrSourceSecurityGroupOwnerAlias()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
@Stability(value=Stable) @NotNull public Object getListeners()
If you update the properties for a listener, AWS CloudFormation deletes the existing listener and creates a new one with the specified properties. While the new listener is being created, clients cannot connect to the load balancer.
@Stability(value=Stable)
public void setListeners(@NotNull
IResolvable value)
If you update the properties for a listener, AWS CloudFormation deletes the existing listener and creates a new one with the specified properties. While the new listener is being created, clients cannot connect to the load balancer.
@Stability(value=Stable)
public void setListeners(@NotNull
List<Object> value)
If you update the properties for a listener, AWS CloudFormation deletes the existing listener and creates a new one with the specified properties. While the new listener is being created, clients cannot connect to the load balancer.
@Stability(value=Stable) @Nullable public Object getAccessLoggingPolicy()
@Stability(value=Stable)
public void setAccessLoggingPolicy(@Nullable
CfnLoadBalancer.AccessLoggingPolicyProperty value)
@Stability(value=Stable)
public void setAccessLoggingPolicy(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public Object getAppCookieStickinessPolicy()
@Stability(value=Stable)
public void setAppCookieStickinessPolicy(@Nullable
IResolvable value)
@Stability(value=Stable)
public void setAppCookieStickinessPolicy(@Nullable
List<Object> value)
@Stability(value=Stable) @Nullable public List<String> getAvailabilityZones()
Update requires replacement if you did not previously specify an Availability Zone or if you are removing all Availability Zones. Otherwise, update requires no interruption.
@Stability(value=Stable)
public void setAvailabilityZones(@Nullable
List<String> value)
Update requires replacement if you did not previously specify an Availability Zone or if you are removing all Availability Zones. Otherwise, update requires no interruption.
@Stability(value=Stable) @Nullable public Object getConnectionDrainingPolicy()
For more information, see Configure Connection Draining in the Classic Load Balancers Guide .
@Stability(value=Stable)
public void setConnectionDrainingPolicy(@Nullable
CfnLoadBalancer.ConnectionDrainingPolicyProperty value)
For more information, see Configure Connection Draining in the Classic Load Balancers Guide .
@Stability(value=Stable)
public void setConnectionDrainingPolicy(@Nullable
IResolvable value)
For more information, see Configure Connection Draining in the Classic Load Balancers Guide .
@Stability(value=Stable) @Nullable public Object getConnectionSettings()
By default, Elastic Load Balancing maintains a 60-second idle connection timeout for both front-end and back-end connections of your load balancer. For more information, see Configure Idle Connection Timeout in the Classic Load Balancers Guide .
@Stability(value=Stable)
public void setConnectionSettings(@Nullable
CfnLoadBalancer.ConnectionSettingsProperty value)
By default, Elastic Load Balancing maintains a 60-second idle connection timeout for both front-end and back-end connections of your load balancer. For more information, see Configure Idle Connection Timeout in the Classic Load Balancers Guide .
@Stability(value=Stable)
public void setConnectionSettings(@Nullable
IResolvable value)
By default, Elastic Load Balancing maintains a 60-second idle connection timeout for both front-end and back-end connections of your load balancer. For more information, see Configure Idle Connection Timeout in the Classic Load Balancers Guide .
@Stability(value=Stable) @Nullable public Object getCrossZone()
For more information, see Configure Cross-Zone Load Balancing in the Classic Load Balancers Guide .
@Stability(value=Stable)
public void setCrossZone(@Nullable
Boolean value)
For more information, see Configure Cross-Zone Load Balancing in the Classic Load Balancers Guide .
@Stability(value=Stable)
public void setCrossZone(@Nullable
IResolvable value)
For more information, see Configure Cross-Zone Load Balancing in the Classic Load Balancers Guide .
@Stability(value=Stable) @Nullable public Object getHealthCheck()
Update requires replacement if you did not previously specify health check settings or if you are removing the health check settings. Otherwise, update requires no interruption.
@Stability(value=Stable)
public void setHealthCheck(@Nullable
CfnLoadBalancer.HealthCheckProperty value)
Update requires replacement if you did not previously specify health check settings or if you are removing the health check settings. Otherwise, update requires no interruption.
@Stability(value=Stable)
public void setHealthCheck(@Nullable
IResolvable value)
Update requires replacement if you did not previously specify health check settings or if you are removing the health check settings. Otherwise, update requires no interruption.
@Stability(value=Stable) @Nullable public List<String> getInstances()
@Stability(value=Stable)
public void setInstances(@Nullable
List<String> value)
@Stability(value=Stable) @Nullable public Object getLbCookieStickinessPolicy()
@Stability(value=Stable)
public void setLbCookieStickinessPolicy(@Nullable
IResolvable value)
@Stability(value=Stable)
public void setLbCookieStickinessPolicy(@Nullable
List<Object> value)
@Stability(value=Stable) @Nullable public String getLoadBalancerName()
This name must be unique within your set of load balancers for the region.
If you don't specify a name, AWS CloudFormation generates a unique physical ID for the load balancer. For more information, see Name Type . If you specify a name, you cannot perform updates that require replacement of this resource, but you can perform other updates. To replace the resource, specify a new name.
@Stability(value=Stable)
public void setLoadBalancerName(@Nullable
String value)
This name must be unique within your set of load balancers for the region.
If you don't specify a name, AWS CloudFormation generates a unique physical ID for the load balancer. For more information, see Name Type . If you specify a name, you cannot perform updates that require replacement of this resource, but you can perform other updates. To replace the resource, specify a new name.
@Stability(value=Stable) @Nullable public Object getPolicies()
Specify only back-end server policies.
@Stability(value=Stable)
public void setPolicies(@Nullable
IResolvable value)
Specify only back-end server policies.
@Stability(value=Stable)
public void setPolicies(@Nullable
List<Object> value)
Specify only back-end server policies.
@Stability(value=Stable) @Nullable public String getScheme()
If Scheme is internet-facing , the load balancer has a public DNS name that resolves to a public IP address.
If Scheme is internal , the load balancer has a public DNS name that resolves to a private IP address.
@Stability(value=Stable)
public void setScheme(@Nullable
String value)
If Scheme is internet-facing , the load balancer has a public DNS name that resolves to a public IP address.
If Scheme is internal , the load balancer has a public DNS name that resolves to a private IP address.
@Stability(value=Stable) @Nullable public List<String> getSecurityGroups()
Valid only for load balancers in a VPC.
@Stability(value=Stable)
public void setSecurityGroups(@Nullable
List<String> value)
Valid only for load balancers in a VPC.
@Stability(value=Stable) @Nullable public List<String> getSubnets()
Update requires replacement if you did not previously specify a subnet or if you are removing all subnets. Otherwise, update requires no interruption. To update to a different subnet in the current Availability Zone, you must first update to a subnet in a different Availability Zone, then update to the new subnet in the original Availability Zone.
@Stability(value=Stable)
public void setSubnets(@Nullable
List<String> value)
Update requires replacement if you did not previously specify a subnet or if you are removing all subnets. Otherwise, update requires no interruption. To update to a different subnet in the current Availability Zone, you must first update to a subnet in a different Availability Zone, then update to the new subnet in the original Availability Zone.
Copyright © 2022. All rights reserved.