Class: AWSCDK::ElasticLoadBalancing::CfnLoadBalancerProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
elastic_load_balancing/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(listeners:, access_logging_policy: nil, app_cookie_stickiness_policy: nil, availability_zones: nil, connection_draining_policy: nil, connection_settings: nil, cross_zone: nil, health_check: nil, instances: nil, lb_cookie_stickiness_policy: nil, load_balancer_name: nil, policies: nil, scheme: nil, security_groups: nil, subnets: nil, tags: nil) ⇒ CfnLoadBalancerProps

Returns a new instance of CfnLoadBalancerProps.

Parameters:



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 25

def initialize(listeners:, access_logging_policy: nil, app_cookie_stickiness_policy: nil, availability_zones: nil, connection_draining_policy: nil, connection_settings: nil, cross_zone: nil, health_check: nil, instances: nil, lb_cookie_stickiness_policy: nil, load_balancer_name: nil, policies: nil, scheme: nil, security_groups: nil, subnets: nil, tags: nil)
  @listeners = listeners
  Jsii::Type.check_type(@listeners, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmcuQ2ZuTG9hZEJhbGFuY2VyLkxpc3RlbmVyc1Byb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "listeners")
  @access_logging_policy = access_logging_policy.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancing::CfnLoadBalancer::AccessLoggingPolicyProperty.new(**access_logging_policy.transform_keys(&:to_sym)) : access_logging_policy
  Jsii::Type.check_type(@access_logging_policy, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZy5DZm5Mb2FkQmFsYW5jZXIuQWNjZXNzTG9nZ2luZ1BvbGljeVByb3BlcnR5In1dfX0=")), "accessLoggingPolicy") unless @access_logging_policy.nil?
  @app_cookie_stickiness_policy = app_cookie_stickiness_policy
  Jsii::Type.check_type(@app_cookie_stickiness_policy, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmcuQ2ZuTG9hZEJhbGFuY2VyLkFwcENvb2tpZVN0aWNraW5lc3NQb2xpY3lQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "appCookieStickinessPolicy") unless @app_cookie_stickiness_policy.nil?
  @availability_zones = availability_zones
  Jsii::Type.check_type(@availability_zones, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "availabilityZones") unless @availability_zones.nil?
  @connection_draining_policy = connection_draining_policy.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancing::CfnLoadBalancer::ConnectionDrainingPolicyProperty.new(**connection_draining_policy.transform_keys(&:to_sym)) : connection_draining_policy
  Jsii::Type.check_type(@connection_draining_policy, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZy5DZm5Mb2FkQmFsYW5jZXIuQ29ubmVjdGlvbkRyYWluaW5nUG9saWN5UHJvcGVydHkifV19fQ==")), "connectionDrainingPolicy") unless @connection_draining_policy.nil?
  @connection_settings = connection_settings.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancing::CfnLoadBalancer::ConnectionSettingsProperty.new(**connection_settings.transform_keys(&:to_sym)) : connection_settings
  Jsii::Type.check_type(@connection_settings, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZy5DZm5Mb2FkQmFsYW5jZXIuQ29ubmVjdGlvblNldHRpbmdzUHJvcGVydHkifV19fQ==")), "connectionSettings") unless @connection_settings.nil?
  @cross_zone = cross_zone
  Jsii::Type.check_type(@cross_zone, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "crossZone") unless @cross_zone.nil?
  @health_check = health_check.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancing::CfnLoadBalancer::HealthCheckProperty.new(**health_check.transform_keys(&:to_sym)) : health_check
  Jsii::Type.check_type(@health_check, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZy5DZm5Mb2FkQmFsYW5jZXIuSGVhbHRoQ2hlY2tQcm9wZXJ0eSJ9XX19")), "healthCheck") unless @health_check.nil?
  @instances = instances
  Jsii::Type.check_type(@instances, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InVuaW9uIjp7InR5cGVzIjpbeyJwcmltaXRpdmUiOiJzdHJpbmcifSx7ImZxbiI6ImF3cy1jZGstbGliLmludGVyZmFjZXMuYXdzX2VjMi5JSW5zdGFuY2VSZWYifV19fSwia2luZCI6ImFycmF5In19")), "instances") unless @instances.nil?
  @lb_cookie_stickiness_policy = lb_cookie_stickiness_policy
  Jsii::Type.check_type(@lb_cookie_stickiness_policy, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmcuQ2ZuTG9hZEJhbGFuY2VyLkxCQ29va2llU3RpY2tpbmVzc1BvbGljeVByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "lbCookieStickinessPolicy") unless @lb_cookie_stickiness_policy.nil?
  @load_balancer_name = load_balancer_name
  Jsii::Type.check_type(@load_balancer_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "loadBalancerName") unless @load_balancer_name.nil?
  @policies = policies
  Jsii::Type.check_type(@policies, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmcuQ2ZuTG9hZEJhbGFuY2VyLlBvbGljaWVzUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "policies") unless @policies.nil?
  @scheme = scheme
  Jsii::Type.check_type(@scheme, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "scheme") unless @scheme.nil?
  @security_groups = security_groups
  Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InVuaW9uIjp7InR5cGVzIjpbeyJwcmltaXRpdmUiOiJzdHJpbmcifSx7ImZxbiI6ImF3cy1jZGstbGliLmludGVyZmFjZXMuYXdzX2VjMi5JU2VjdXJpdHlHcm91cFJlZiJ9XX19LCJraW5kIjoiYXJyYXkifX0=")), "securityGroups") unless @security_groups.nil?
  @subnets = subnets
  Jsii::Type.check_type(@subnets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InVuaW9uIjp7InR5cGVzIjpbeyJwcmltaXRpdmUiOiJzdHJpbmcifSx7ImZxbiI6ImF3cy1jZGstbGliLmludGVyZmFjZXMuYXdzX2VjMi5JU3VibmV0UmVmIn1dfX0sImtpbmQiOiJhcnJheSJ9fQ==")), "subnets") unless @subnets.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?
end

Instance Attribute Details

#access_logging_policyAWSCDK::IResolvable, ... (readonly)

Information about where and how access logs are stored for the load balancer.



71
72
73
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 71

def access_logging_policy
  @access_logging_policy
end

Information about a policy for application-controlled session stickiness.



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

def app_cookie_stickiness_policy
  @app_cookie_stickiness_policy
end

#availability_zonesArray<String>? (readonly)

The Availability Zones for a load balancer in a default VPC.

For a load balancer in a nondefault VPC, specify Subnets instead.

Update requires replacement if you did not previously specify an Availability Zone or if you are removing all Availability Zones. Otherwise, update requires no interruption.



85
86
87
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 85

def availability_zones
  @availability_zones
end

#connection_draining_policyAWSCDK::IResolvable, ... (readonly)

If enabled, the load balancer allows existing requests to complete before the load balancer shifts traffic away from a deregistered or unhealthy instance.

For more information, see Configure connection draining in the User Guide for Classic Load Balancers .



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

def connection_draining_policy
  @connection_draining_policy
end

#connection_settingsAWSCDK::IResolvable, ... (readonly)

If enabled, the load balancer allows the connections to remain idle (no data is sent over the connection) for the specified duration.

By default, Elastic Load Balancing maintains a 60-second idle connection timeout for both front-end and back-end connections of your load balancer. For more information, see Configure idle connection timeout in the User Guide for Classic Load Balancers .



99
100
101
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 99

def connection_settings
  @connection_settings
end

#cross_zoneBoolean, ... (readonly)

If enabled, the load balancer routes the request traffic evenly across all instances regardless of the Availability Zones.

For more information, see Configure cross-zone load balancing in the User Guide for Classic Load Balancers .



106
107
108
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 106

def cross_zone
  @cross_zone
end

#health_checkAWSCDK::IResolvable, ... (readonly)

The health check settings to use when evaluating the health of your EC2 instances.

Update requires replacement if you did not previously specify health check settings or if you are removing the health check settings. Otherwise, update requires no interruption.



113
114
115
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 113

def health_check
  @health_check
end

#instancesArray<String, AWSCDK::Interfaces::AWSEC2::IInstanceRef>? (readonly)

The IDs of the instances for the load balancer.



118
119
120
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 118

def instances
  @instances
end

Information about a policy for duration-based session stickiness.



123
124
125
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 123

def lb_cookie_stickiness_policy
  @lb_cookie_stickiness_policy
end

#listenersAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::ElasticLoadBalancing::CfnLoadBalancer::ListenersProperty> (readonly)

The listeners for the load balancer. You can specify at most one listener per port.

If you update the properties for a listener, AWS CloudFormation deletes the existing listener and creates a new one with the specified properties. While the new listener is being created, clients cannot connect to the load balancer.



66
67
68
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 66

def listeners
  @listeners
end

#load_balancer_nameString? (readonly)

The name of the load balancer.

This name must be unique within your set of load balancers for the region.

If you don't specify a name, AWS CloudFormation generates a unique physical ID for the load balancer. For more information, see Name Type . If you specify a name, you cannot perform updates that require replacement of this resource, but you can perform other updates. To replace the resource, specify a new name.



132
133
134
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 132

def load_balancer_name
  @load_balancer_name
end

#policiesAWSCDK::IResolvable, ... (readonly)

The policies defined for your Classic Load Balancer.

Specify only back-end server policies.



139
140
141
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 139

def policies
  @policies
end

#schemeString? (readonly)

The type of load balancer. Valid only for load balancers in a VPC.

If Scheme is internet-facing , the load balancer has a public DNS name that resolves to a public IP address.

If Scheme is internal , the load balancer has a public DNS name that resolves to a private IP address.



148
149
150
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 148

def scheme
  @scheme
end

#security_groupsArray<String, AWSCDK::Interfaces::AWSEC2::ISecurityGroupRef>? (readonly)

The security groups for the load balancer.

Valid only for load balancers in a VPC.



155
156
157
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 155

def security_groups
  @security_groups
end

#subnetsArray<String, AWSCDK::Interfaces::AWSEC2::ISubnetRef>? (readonly)

The IDs of the subnets for the load balancer. You can specify at most one subnet per Availability Zone.

Update requires replacement if you did not previously specify a subnet or if you are removing all subnets. Otherwise, update requires no interruption. To update to a different subnet in the current Availability Zone, you must first update to a subnet in a different Availability Zone, then update to the new subnet in the original Availability Zone.



162
163
164
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 162

def subnets
  @subnets
end

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

The tags associated with a load balancer.



167
168
169
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 167

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 169

def self.jsii_properties
  {
    :listeners => "listeners",
    :access_logging_policy => "accessLoggingPolicy",
    :app_cookie_stickiness_policy => "appCookieStickinessPolicy",
    :availability_zones => "availabilityZones",
    :connection_draining_policy => "connectionDrainingPolicy",
    :connection_settings => "connectionSettings",
    :cross_zone => "crossZone",
    :health_check => "healthCheck",
    :instances => "instances",
    :lb_cookie_stickiness_policy => "lbCookieStickinessPolicy",
    :load_balancer_name => "loadBalancerName",
    :policies => "policies",
    :scheme => "scheme",
    :security_groups => "securityGroups",
    :subnets => "subnets",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'elastic_load_balancing/cfn_load_balancer_props.rb', line 190

def to_jsii
  result = {}
  result.merge!({
    "listeners" => @listeners,
    "accessLoggingPolicy" => @access_logging_policy,
    "appCookieStickinessPolicy" => @app_cookie_stickiness_policy,
    "availabilityZones" => @availability_zones,
    "connectionDrainingPolicy" => @connection_draining_policy,
    "connectionSettings" => @connection_settings,
    "crossZone" => @cross_zone,
    "healthCheck" => @health_check,
    "instances" => @instances,
    "lbCookieStickinessPolicy" => @lb_cookie_stickiness_policy,
    "loadBalancerName" => @load_balancer_name,
    "policies" => @policies,
    "scheme" => @scheme,
    "securityGroups" => @security_groups,
    "subnets" => @subnets,
    "tags" => @tags,
  })
  result.compact
end