@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:40.667Z") @Stability(value=Stable) public class CfnLoadBalancer extends CfnResource implements IInspectable
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();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnLoadBalancer.Builder
A fluent builder for
CfnLoadBalancer. |
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::Lightsail::LoadBalancer`.
|
protected |
CfnLoadBalancer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnLoadBalancer(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getAttachedInstances()
The Lightsail instances to attach to the load balancer.
|
String |
getAttrLoadBalancerArn()
The Amazon Resource Name (ARN) of the load balancer.
|
protected Map<String,Object> |
getCfnProperties() |
String |
getHealthCheckPath()
The path on the attached instance where the health check will be performed.
|
Number |
getInstancePort()
The port that the load balancer uses to direct traffic to your Lightsail instances.
|
String |
getIpAddressType()
The IP address type of the load balancer.
|
String |
getLoadBalancerName()
The name of the load balancer.
|
Object |
getSessionStickinessEnabled()
A Boolean value indicating whether session stickiness is enabled.
|
String |
getSessionStickinessLbCookieDurationSeconds()
The time period, in seconds, after which the load balancer session stickiness cookie should be considered stale.
|
TagManager |
getTags()
An array of key-value pairs to apply to this resource.
|
String |
getTlsPolicyName()
The name of the TLS security policy for the load balancer.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
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 |
setSessionStickinessEnabled(Boolean value)
A Boolean value indicating whether session stickiness is enabled.
|
void |
setSessionStickinessEnabled(IResolvable value)
A Boolean value indicating whether session stickiness is enabled.
|
void |
setSessionStickinessLbCookieDurationSeconds(String value)
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.
|
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 getAttrLoadBalancerArn()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
For more information, see Tag in the AWS CloudFormation User Guide .
The
ValueofTagsis optional for Lightsail resources.
@Stability(value=Stable) @NotNull public Number getInstancePort()
For HTTP traffic, specify port 80 . For HTTPS traffic, specify port 443 .
@Stability(value=Stable)
public void setInstancePort(@NotNull
Number value)
For HTTP traffic, specify port 80 . For HTTPS traffic, specify port 443 .
@Stability(value=Stable) @NotNull public String getLoadBalancerName()
@Stability(value=Stable)
public void setLoadBalancerName(@NotNull
String value)
@Stability(value=Stable) @Nullable public List<String> getAttachedInstances()
@Stability(value=Stable)
public void setAttachedInstances(@Nullable
List<String> value)
@Stability(value=Stable) @Nullable public String getHealthCheckPath()
If no path is specified, the load balancer tries to make a request to the default (root) page ( /index.html ).
@Stability(value=Stable)
public void setHealthCheckPath(@Nullable
String value)
If no path is specified, the load balancer tries to make a request to the default (root) page ( /index.html ).
@Stability(value=Stable) @Nullable public String getIpAddressType()
The possible values are ipv4 for IPv4 only, and dualstack for both IPv4 and IPv6.
@Stability(value=Stable)
public void setIpAddressType(@Nullable
String value)
The possible values are ipv4 for IPv4 only, and dualstack for both IPv4 and IPv6.
@Stability(value=Stable) @Nullable public Object getSessionStickinessEnabled()
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.
@Stability(value=Stable)
public void setSessionStickinessEnabled(@Nullable
Boolean value)
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.
@Stability(value=Stable)
public void setSessionStickinessEnabled(@Nullable
IResolvable value)
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.
@Stability(value=Stable) @Nullable public String getSessionStickinessLbCookieDurationSeconds()
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.
@Stability(value=Stable)
public void setSessionStickinessLbCookieDurationSeconds(@Nullable
String value)
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.
@Stability(value=Stable) @Nullable public String getTlsPolicyName()
@Stability(value=Stable)
public void setTlsPolicyName(@Nullable
String value)
Copyright © 2022. All rights reserved.