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.lightsail.CfnLoadBalancer
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,ILoadBalancerRef,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-05T22:26:39.766Z")
@Stability(Stable)
public class CfnLoadBalancer
extends CfnResource
implements IInspectable, ILoadBalancerRef, ITaggable
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();
- See Also:
-
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.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.lightsail.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, CfnLoadBalancerProps props) Create a newAWS::Lightsail::LoadBalancer. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForLoadBalancer(ILoadBalancerRef resource) The 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 reference to a LoadBalancer resource.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()Tag Manager which manages the tags for this resource.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.static BooleanChecks whether the given object is a CfnLoadBalancer.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.voidsetTagsRaw(List<CfnTag> value) An array of key-value pairs to apply to this resource.voidsetTlsPolicyName(String value) The name of the TLS security policy for the 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, @NotNull CfnLoadBalancerProps props) Create a newAWS::Lightsail::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. 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.
-
getAttrLoadBalancerArn
The Amazon Resource Name (ARN) of 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. -
getInstancePort
The port that the load balancer uses to direct traffic to your Lightsail instances. -
setInstancePort
The port that the load balancer uses to direct traffic to your Lightsail instances. -
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. -
setHealthCheckPath
The path on the attached instance where the health check will be performed. -
getIpAddressType
The IP address type of the load balancer. -
setIpAddressType
The IP address type of the load balancer. -
getSessionStickinessEnabled
A Boolean value indicating whether session stickiness is enabled.Returns union: either
BooleanorIResolvable -
setSessionStickinessEnabled
A Boolean value indicating whether session stickiness is enabled. -
setSessionStickinessEnabled
A Boolean value indicating whether session stickiness is enabled. -
getSessionStickinessLbCookieDurationSeconds
The time period, in seconds, after which the load balancer session stickiness cookie should be considered stale. -
setSessionStickinessLbCookieDurationSeconds
The time period, in seconds, after which the load balancer session stickiness cookie should be considered stale. -
getTagsRaw
An array of key-value pairs to apply to this resource. -
setTagsRaw
An array of key-value pairs to apply to this resource. -
getTlsPolicyName
The name of the TLS security policy for the load balancer. -
setTlsPolicyName
The name of the TLS security policy for the load balancer.
-