aws-cdk-lib.aws_lightsail.CfnLoadBalancerProps

interface CfnLoadBalancerProps

LanguageType name
.NETAmazon.CDK.AWS.Lightsail.CfnLoadBalancerProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslightsail#CfnLoadBalancerProps
Javasoftware.amazon.awscdk.services.lightsail.CfnLoadBalancerProps
Pythonaws_cdk.aws_lightsail.CfnLoadBalancerProps
TypeScript aws-cdk-lib » aws_lightsail » CfnLoadBalancerProps

Properties for defining a CfnLoadBalancer.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lightsail as lightsail } from 'aws-cdk-lib';
const cfnLoadBalancerProps: lightsail.CfnLoadBalancerProps = {
  instancePort: 123,
  loadBalancerName: 'loadBalancerName',

  // the properties below are optional
  attachedInstances: ['attachedInstances'],
  healthCheckPath: 'healthCheckPath',
  ipAddressType: 'ipAddressType',
  sessionStickinessEnabled: false,
  sessionStickinessLbCookieDurationSeconds: 'sessionStickinessLbCookieDurationSeconds',
  tags: [{
    key: 'key',
    value: 'value',
  }],
  tlsPolicyName: 'tlsPolicyName',
};

Properties

NameTypeDescription
instancePortnumberThe port that the load balancer uses to direct traffic to your Lightsail instances.
loadBalancerNamestringThe name of the load balancer.
attachedInstances?string[]The Lightsail instances to attach to the load balancer.
healthCheckPath?stringThe path on the attached instance where the health check will be performed.
ipAddressType?stringThe IP address type of the load balancer.
sessionStickinessEnabled?boolean | IResolvableA Boolean value indicating whether session stickiness is enabled.
sessionStickinessLbCookieDurationSeconds?stringThe time period, in seconds, after which the load balancer session stickiness cookie should be considered stale.
tags?CfnTag[]An array of key-value pairs to apply to this resource.
tlsPolicyName?stringThe name of the TLS security policy for the load balancer.

instancePort

Type: number

The port that the load balancer uses to direct traffic to your Lightsail instances.

For HTTP traffic, specify port 80 . For HTTPS traffic, specify port 443 .


loadBalancerName

Type: string

The name of the load balancer.


attachedInstances?

Type: string[] (optional)

The Lightsail instances to attach to the load balancer.


healthCheckPath?

Type: string (optional)

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 ).


ipAddressType?

Type: string (optional)

The IP address type of the load balancer.

The possible values are ipv4 for IPv4 only, and dualstack for both IPv4 and IPv6.


sessionStickinessEnabled?

Type: boolean | IResolvable (optional)

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.


sessionStickinessLbCookieDurationSeconds?

Type: string (optional)

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.


tags?

Type: CfnTag[] (optional)

An array of key-value pairs to apply to this resource.

For more information, see Tag in the AWS CloudFormation User Guide .

The Value of Tags is optional for Lightsail resources.


tlsPolicyName?

Type: string (optional)

The name of the TLS security policy for the load balancer.