CfnLoadBalancerProps

class aws_cdk.aws_lightsail.CfnLoadBalancerProps(*, instance_port, load_balancer_name, attached_instances=None, health_check_path=None, ip_address_type=None, session_stickiness_enabled=None, session_stickiness_lb_cookie_duration_seconds=None, tags=None, tls_policy_name=None)

Bases: object

Properties for defining a CfnLoadBalancer.

Parameters
  • instance_port (Union[int, float]) – 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 .

  • load_balancer_name (str) – The name of the load balancer.

  • attached_instances (Optional[Sequence[str]]) – The Lightsail instances to attach to the load balancer.

  • health_check_path (Optional[str]) – 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 ).

  • ip_address_type (Optional[str]) – The IP address type of the load balancer. The possible values are ipv4 for IPv4 only, and dualstack for both IPv4 and IPv6.

  • session_stickiness_enabled (Union[bool, IResolvable, None]) – 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.

  • session_stickiness_lb_cookie_duration_seconds (Optional[str]) – 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 (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – An array of key-value pairs to apply to this resource. For more information, see Tag in the AWS CloudFormation User Guide . .. epigraph:: The Value of Tags is optional for Lightsail resources.

  • tls_policy_name (Optional[str]) – The name of the TLS security policy for the load balancer.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-loadbalancer.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_lightsail as lightsail

cfn_load_balancer_props = lightsail.CfnLoadBalancerProps(
    instance_port=123,
    load_balancer_name="loadBalancerName",

    # the properties below are optional
    attached_instances=["attachedInstances"],
    health_check_path="healthCheckPath",
    ip_address_type="ipAddressType",
    session_stickiness_enabled=False,
    session_stickiness_lb_cookie_duration_seconds="sessionStickinessLbCookieDurationSeconds",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    tls_policy_name="tlsPolicyName"
)

Attributes

attached_instances

The Lightsail instances to attach to the load balancer.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-loadbalancer.html#cfn-lightsail-loadbalancer-attachedinstances

Return type

Optional[List[str]]

health_check_path

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-loadbalancer.html#cfn-lightsail-loadbalancer-healthcheckpath

Return type

Optional[str]

instance_port

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 .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-loadbalancer.html#cfn-lightsail-loadbalancer-instanceport

Return type

Union[int, float]

ip_address_type

The IP address type of the load balancer.

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-loadbalancer.html#cfn-lightsail-loadbalancer-ipaddresstype

Return type

Optional[str]

load_balancer_name

The name of the load balancer.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-loadbalancer.html#cfn-lightsail-loadbalancer-loadbalancername

Return type

str

session_stickiness_enabled

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.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-loadbalancer.html#cfn-lightsail-loadbalancer-sessionstickinessenabled

Return type

Union[bool, IResolvable, None]

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.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-loadbalancer.html#cfn-lightsail-loadbalancer-sessionstickinesslbcookiedurationseconds

Return type

Optional[str]

tags

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

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

The ``Value`` of ``Tags`` is optional for Lightsail resources.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-loadbalancer.html#cfn-lightsail-loadbalancer-tags

Return type

Optional[List[CfnTag]]

tls_policy_name

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-loadbalancer.html#cfn-lightsail-loadbalancer-tlspolicyname

Return type

Optional[str]