Class CfnLoadBalancer
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
AWS::Lightsail::LoadBalancer
.
The AWS::Lightsail::LoadBalancer
resource specifies a load balancer that can be used with Lightsail instances.
You cannot attach a TLS certificate to a load balancer using the
AWS::Lightsail::LoadBalancer
resource type. Instead, use theAWS::Lightsail::LoadBalancerTlsCertificate
resource type to create a certificate and attach it to a 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.lightsail.*; CfnLoadBalancer cfnLoadBalancer = CfnLoadBalancer.Builder.create(this, "MyCfnLoadBalancer") .instancePort(123) .loadBalancerName("loadBalancerName") // the properties below are optional .attachedInstances(List.of("attachedInstances")) .healthCheckPath("healthCheckPath") .ipAddressType("ipAddressType") .sessionStickinessEnabled(false) .sessionStickinessLbCookieDurationSeconds("sessionStickinessLbCookieDurationSeconds") .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .tlsPolicyName("tlsPolicyName") .build();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnLoadBalancer
(Construct scope, String id, CfnLoadBalancerProps props) Create a newAWS::Lightsail::LoadBalancer
.protected
CfnLoadBalancer
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnLoadBalancer
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe Lightsail instances to attach to the load balancer.The Amazon Resource Name (ARN) of the load balancer.The path on the attached instance where the health check will be performed.The port that the load balancer uses to direct traffic to your Lightsail instances.The IP address type of the load balancer.The name of the load balancer.A Boolean value indicating whether session stickiness is enabled.The time period, in seconds, after which the load balancer session stickiness cookie should be considered stale.getTags()
An array of key-value pairs to apply to this resource.The name of the TLS security policy for the load balancer.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setAttachedInstances
(List<String> value) The Lightsail instances to attach to the load balancer.void
setHealthCheckPath
(String value) The path on the attached instance where the health check will be performed.void
setInstancePort
(Number value) The port that the load balancer uses to direct traffic to your Lightsail instances.void
setIpAddressType
(String value) The IP address type of the load balancer.void
setLoadBalancerName
(String value) The name of the load balancer.void
A Boolean value indicating whether session stickiness is enabled.void
A Boolean value indicating whether session stickiness is enabled.void
The time period, in seconds, after which the load balancer session stickiness cookie should be considered stale.void
setTlsPolicyName
(String value) The name of the TLS security policy for the load balancer.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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 Construct scope, @NotNull String id, @NotNull CfnLoadBalancerProps props) Create a newAWS::Lightsail::LoadBalancer
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrLoadBalancerArn
The Amazon Resource Name (ARN) of the load balancer. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
An array of key-value pairs to apply to this resource.For more information, see Tag in the AWS CloudFormation User Guide .
The
Value
ofTags
is optional for Lightsail resources. -
getInstancePort
The port that the load balancer uses to direct traffic to your Lightsail instances.For HTTP traffic, specify port
80
. For HTTPS traffic, specify port443
. -
setInstancePort
The port that the load balancer uses to direct traffic to your Lightsail instances.For HTTP traffic, specify port
80
. For HTTPS traffic, specify port443
. -
getLoadBalancerName
The name of the load balancer. -
setLoadBalancerName
The name of the load balancer. -
getAttachedInstances
The Lightsail instances to attach to the load balancer. -
setAttachedInstances
The Lightsail instances to attach to the load balancer. -
getHealthCheckPath
The path on the attached instance where the health check will be performed.If no path is specified, the load balancer tries to make a request to the default (root) page (
/index.html
). -
setHealthCheckPath
The path on the attached instance where the health check will be performed.If no path is specified, the load balancer tries to make a request to the default (root) page (
/index.html
). -
getIpAddressType
The IP address type of the load balancer.The possible values are
ipv4
for IPv4 only, anddualstack
for both IPv4 and IPv6. -
setIpAddressType
The IP address type of the load balancer.The possible values are
ipv4
for IPv4 only, anddualstack
for both IPv4 and IPv6. -
getSessionStickinessEnabled
A Boolean value indicating whether session stickiness is enabled.Enable session stickiness (also known as session affinity ) to bind a user's session to a specific instance. This ensures that all requests from the user during the session are sent to the same instance.
-
setSessionStickinessEnabled
A Boolean value indicating whether session stickiness is enabled.Enable session stickiness (also known as session affinity ) to bind a user's session to a specific instance. This ensures that all requests from the user during the session are sent to the same instance.
-
setSessionStickinessEnabled
A Boolean value indicating whether session stickiness is enabled.Enable session stickiness (also known as session affinity ) to bind a user's session to a specific instance. This ensures that all requests from the user during the session are sent to the same instance.
-
getSessionStickinessLbCookieDurationSeconds
The time period, in seconds, after which the load balancer session stickiness cookie should be considered stale.If you do not specify this parameter, the default value is 0, which indicates that the sticky session should last for the duration of the browser session.
-
setSessionStickinessLbCookieDurationSeconds
The time period, in seconds, after which the load balancer session stickiness cookie should be considered stale.If you do not specify this parameter, the default value is 0, which indicates that the sticky session should last for the duration of the browser session.
-
getTlsPolicyName
The name of the TLS security policy for the load balancer. -
setTlsPolicyName
The name of the TLS security policy for the load balancer.
-