@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:38.417Z") 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::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();
Modifier and Type | Class and Description |
---|---|
static class |
CfnLoadBalancer.Builder
A fluent builder for
CfnLoadBalancer . |
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnLoadBalancer(Construct scope,
java.lang.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 |
---|---|
java.util.List<java.lang.String> |
getAttachedInstances()
The Lightsail instances to attach to the load balancer.
|
java.lang.String |
getAttrLoadBalancerArn()
The Amazon Resource Name (ARN) of the load balancer.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getHealthCheckPath()
The path on the attached instance where the health check will be performed.
|
java.lang.Number |
getInstancePort()
The port that the load balancer uses to direct traffic to your Lightsail instances.
|
java.lang.String |
getIpAddressType()
The IP address type of the load balancer.
|
java.lang.String |
getLoadBalancerName()
The name of the load balancer.
|
java.lang.Object |
getSessionStickinessEnabled()
A Boolean value indicating whether session stickiness is enabled.
|
java.lang.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.
|
java.lang.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 java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setAttachedInstances(java.util.List<java.lang.String> value)
The Lightsail instances to attach to the load balancer.
|
void |
setHealthCheckPath(java.lang.String value)
The path on the attached instance where the health check will be performed.
|
void |
setInstancePort(java.lang.Number value)
The port that the load balancer uses to direct traffic to your Lightsail instances.
|
void |
setIpAddressType(java.lang.String value)
The IP address type of the load balancer.
|
void |
setLoadBalancerName(java.lang.String value)
The name of the load balancer.
|
void |
setSessionStickinessEnabled(java.lang.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(java.lang.String value)
The time period, in seconds, after which the load balancer session stickiness cookie should be considered stale.
|
void |
setTlsPolicyName(java.lang.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, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnLoadBalancer(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnLoadBalancer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnLoadBalancer(Construct scope, java.lang.String id, 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.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrLoadBalancerArn()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
For more information, see Tag in the AWS CloudFormation User Guide .
The
Value
ofTags
is optional for Lightsail resources.
public java.lang.Number getInstancePort()
For HTTP traffic, specify port 80
. For HTTPS traffic, specify port 443
.
public void setInstancePort(java.lang.Number value)
For HTTP traffic, specify port 80
. For HTTPS traffic, specify port 443
.
public java.lang.String getLoadBalancerName()
public void setLoadBalancerName(java.lang.String value)
public java.util.List<java.lang.String> getAttachedInstances()
public void setAttachedInstances(java.util.List<java.lang.String> value)
public java.lang.String getHealthCheckPath()
If no path is specified, the load balancer tries to make a request to the default (root) page ( /index.html
).
public void setHealthCheckPath(java.lang.String value)
If no path is specified, the load balancer tries to make a request to the default (root) page ( /index.html
).
public java.lang.String getIpAddressType()
The possible values are ipv4
for IPv4 only, and dualstack
for both IPv4 and IPv6.
public void setIpAddressType(java.lang.String value)
The possible values are ipv4
for IPv4 only, and dualstack
for both IPv4 and IPv6.
public java.lang.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.
public void setSessionStickinessEnabled(java.lang.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.
public void setSessionStickinessEnabled(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.
public java.lang.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.
public void setSessionStickinessLbCookieDurationSeconds(java.lang.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.
public java.lang.String getTlsPolicyName()
public void setTlsPolicyName(java.lang.String value)