Class: AWSCDK::Lightsail::CfnLoadBalancerProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
lightsail/cfn_load_balancer_props.rb

Overview

Properties for defining a CfnLoadBalancer.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance_port:, load_balancer_name:, attached_instances: nil, health_check_path: nil, ip_address_type: nil, session_stickiness_enabled: nil, session_stickiness_lb_cookie_duration_seconds: nil, tags: nil, tls_policy_name: nil) ⇒ CfnLoadBalancerProps

Returns a new instance of CfnLoadBalancerProps.

Parameters:

  • instance_port (Numeric)

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

  • load_balancer_name (String)

    The name of the load balancer.

  • attached_instances (Array<String>, nil) (defaults to: nil)

    The Lightsail instances to attach to the load balancer.

  • health_check_path (String, nil) (defaults to: nil)

    The path on the attached instance where the health check will be performed.

  • ip_address_type (String, nil) (defaults to: nil)

    The IP address type of the load balancer.

  • session_stickiness_enabled (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    A Boolean value indicating whether session stickiness is enabled.

  • session_stickiness_lb_cookie_duration_seconds (String, nil) (defaults to: nil)

    The time period, in seconds, after which the load balancer session stickiness cookie should be considered stale.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

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

  • tls_policy_name (String, nil) (defaults to: nil)

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



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lightsail/cfn_load_balancer_props.rb', line 18

def initialize(instance_port:, load_balancer_name:, attached_instances: nil, health_check_path: nil, ip_address_type: nil, session_stickiness_enabled: nil, session_stickiness_lb_cookie_duration_seconds: nil, tags: nil, tls_policy_name: nil)
  @instance_port = instance_port
  Jsii::Type.check_type(@instance_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "instancePort")
  @load_balancer_name = load_balancer_name
  Jsii::Type.check_type(@load_balancer_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "loadBalancerName")
  @attached_instances = attached_instances
  Jsii::Type.check_type(@attached_instances, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "attachedInstances") unless @attached_instances.nil?
  @health_check_path = health_check_path
  Jsii::Type.check_type(@health_check_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "healthCheckPath") unless @health_check_path.nil?
  @ip_address_type = ip_address_type
  Jsii::Type.check_type(@ip_address_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ipAddressType") unless @ip_address_type.nil?
  @session_stickiness_enabled = session_stickiness_enabled
  Jsii::Type.check_type(@session_stickiness_enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "sessionStickinessEnabled") unless @session_stickiness_enabled.nil?
  @session_stickiness_lb_cookie_duration_seconds = session_stickiness_lb_cookie_duration_seconds
  Jsii::Type.check_type(@session_stickiness_lb_cookie_duration_seconds, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sessionStickinessLbCookieDurationSeconds") unless @session_stickiness_lb_cookie_duration_seconds.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @tls_policy_name = tls_policy_name
  Jsii::Type.check_type(@tls_policy_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tlsPolicyName") unless @tls_policy_name.nil?
end

Instance Attribute Details

#attached_instancesArray<String>? (readonly)

The Lightsail instances to attach to the load balancer.



55
56
57
# File 'lightsail/cfn_load_balancer_props.rb', line 55

def attached_instances
  @attached_instances
end

#health_check_pathString? (readonly)

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



62
63
64
# File 'lightsail/cfn_load_balancer_props.rb', line 62

def health_check_path
  @health_check_path
end

#instance_portNumeric (readonly)

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 .



45
46
47
# File 'lightsail/cfn_load_balancer_props.rb', line 45

def instance_port
  @instance_port
end

#ip_address_typeString? (readonly)

The IP address type of the load balancer.

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



69
70
71
# File 'lightsail/cfn_load_balancer_props.rb', line 69

def ip_address_type
  @ip_address_type
end

#load_balancer_nameString (readonly)

The name of the load balancer.



50
51
52
# File 'lightsail/cfn_load_balancer_props.rb', line 50

def load_balancer_name
  @load_balancer_name
end

#session_stickiness_enabledBoolean, ... (readonly)

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.



76
77
78
# File 'lightsail/cfn_load_balancer_props.rb', line 76

def session_stickiness_enabled
  @session_stickiness_enabled
end

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.



83
84
85
# File 'lightsail/cfn_load_balancer_props.rb', line 83

def session_stickiness_lb_cookie_duration_seconds
  @session_stickiness_lb_cookie_duration_seconds
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

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.



92
93
94
# File 'lightsail/cfn_load_balancer_props.rb', line 92

def tags
  @tags
end

#tls_policy_nameString? (readonly)

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



97
98
99
# File 'lightsail/cfn_load_balancer_props.rb', line 97

def tls_policy_name
  @tls_policy_name
end

Class Method Details

.jsii_propertiesObject



99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lightsail/cfn_load_balancer_props.rb', line 99

def self.jsii_properties
  {
    :instance_port => "instancePort",
    :load_balancer_name => "loadBalancerName",
    :attached_instances => "attachedInstances",
    :health_check_path => "healthCheckPath",
    :ip_address_type => "ipAddressType",
    :session_stickiness_enabled => "sessionStickinessEnabled",
    :session_stickiness_lb_cookie_duration_seconds => "sessionStickinessLbCookieDurationSeconds",
    :tags => "tags",
    :tls_policy_name => "tlsPolicyName",
  }
end

Instance Method Details

#to_jsiiObject



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lightsail/cfn_load_balancer_props.rb', line 113

def to_jsii
  result = {}
  result.merge!({
    "instancePort" => @instance_port,
    "loadBalancerName" => @load_balancer_name,
    "attachedInstances" => @attached_instances,
    "healthCheckPath" => @health_check_path,
    "ipAddressType" => @ip_address_type,
    "sessionStickinessEnabled" => @session_stickiness_enabled,
    "sessionStickinessLbCookieDurationSeconds" => @session_stickiness_lb_cookie_duration_seconds,
    "tags" => @tags,
    "tlsPolicyName" => @tls_policy_name,
  })
  result.compact
end