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::LoadBalancerresource type. Instead, use theAWS::Lightsail::LoadBalancerTlsCertificateresource 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.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnLoadBalancer(Construct scope, String id, CfnLoadBalancerProps props) Create a newAWS::Lightsail::LoadBalancer.protectedCfnLoadBalancer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnLoadBalancer(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.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetAttachedInstances(List<String> value) The Lightsail instances to attach to the load balancer.voidsetHealthCheckPath(String value) The path on the attached instance where the health check will be performed.voidsetInstancePort(Number value) The port that the load balancer uses to direct traffic to your Lightsail instances.voidsetIpAddressType(String value) The IP address type of the load balancer.voidsetLoadBalancerName(String value) The name of the load balancer.voidA Boolean value indicating whether session stickiness is enabled.voidA Boolean value indicating whether session stickiness is enabled.voidThe time period, in seconds, after which the load balancer session stickiness cookie should be considered stale.voidsetTlsPolicyName(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, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods 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.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:
inspectin 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrLoadBalancerArn
The Amazon Resource Name (ARN) of the load balancer. -
getCfnProperties
- Overrides:
getCfnPropertiesin 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
ValueofTagsis 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
ipv4for IPv4 only, anddualstackfor both IPv4 and IPv6. -
setIpAddressType
The IP address type of the load balancer.The possible values are
ipv4for IPv4 only, anddualstackfor 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.
-