Class: AWSCDK::ElasticLoadBalancingv2::ApplicationTargetGroupProps

Inherits:
BaseTargetGroupProps
  • Object
show all
Defined in:
elastic_load_balancingv2/application_target_group_props.rb

Overview

Properties for defining an Application Target Group.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cross_zone_enabled: nil, deregistration_delay: nil, health_check: nil, ip_address_type: nil, target_group_health: nil, target_group_name: nil, target_type: nil, vpc: nil, enable_anomaly_mitigation: nil, load_balancing_algorithm_type: nil, multi_value_headers_enabled: nil, port: nil, protocol: nil, protocol_version: nil, slow_start: nil, stickiness_cookie_duration: nil, stickiness_cookie_name: nil, targets: nil) ⇒ ApplicationTargetGroupProps

Returns a new instance of ApplicationTargetGroupProps.

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
59
60
61
62
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 25

def initialize(cross_zone_enabled: nil, deregistration_delay: nil, health_check: nil, ip_address_type: nil, target_group_health: nil, target_group_name: nil, target_type: nil, vpc: nil, enable_anomaly_mitigation: nil, load_balancing_algorithm_type: nil, multi_value_headers_enabled: nil, port: nil, protocol: nil, protocol_version: nil, slow_start: nil, stickiness_cookie_duration: nil, stickiness_cookie_name: nil, targets: nil)
  @cross_zone_enabled = cross_zone_enabled
  Jsii::Type.check_type(@cross_zone_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "crossZoneEnabled") unless @cross_zone_enabled.nil?
  @deregistration_delay = deregistration_delay
  Jsii::Type.check_type(@deregistration_delay, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "deregistrationDelay") unless @deregistration_delay.nil?
  @health_check = health_check.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::HealthCheck.new(**health_check.transform_keys(&:to_sym)) : health_check
  Jsii::Type.check_type(@health_check, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5IZWFsdGhDaGVjayJ9")), "healthCheck") unless @health_check.nil?
  @ip_address_type = ip_address_type
  Jsii::Type.check_type(@ip_address_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5UYXJnZXRHcm91cElwQWRkcmVzc1R5cGUifQ==")), "ipAddressType") unless @ip_address_type.nil?
  @target_group_health = target_group_health.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::TargetGroupHealth.new(**target_group_health.transform_keys(&:to_sym)) : target_group_health
  Jsii::Type.check_type(@target_group_health, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5UYXJnZXRHcm91cEhlYWx0aCJ9")), "targetGroupHealth") unless @target_group_health.nil?
  @target_group_name = target_group_name
  Jsii::Type.check_type(@target_group_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetGroupName") unless @target_group_name.nil?
  @target_type = target_type
  Jsii::Type.check_type(@target_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5UYXJnZXRUeXBlIn0=")), "targetType") unless @target_type.nil?
  @vpc = vpc
  Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc") unless @vpc.nil?
  @enable_anomaly_mitigation = enable_anomaly_mitigation
  Jsii::Type.check_type(@enable_anomaly_mitigation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableAnomalyMitigation") unless @enable_anomaly_mitigation.nil?
  @load_balancing_algorithm_type = load_balancing_algorithm_type
  Jsii::Type.check_type(@load_balancing_algorithm_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5UYXJnZXRHcm91cExvYWRCYWxhbmNpbmdBbGdvcml0aG1UeXBlIn0=")), "loadBalancingAlgorithmType") unless @load_balancing_algorithm_type.nil?
  @multi_value_headers_enabled = multi_value_headers_enabled
  Jsii::Type.check_type(@multi_value_headers_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "multiValueHeadersEnabled") unless @multi_value_headers_enabled.nil?
  @port = port
  Jsii::Type.check_type(@port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port") unless @port.nil?
  @protocol = protocol
  Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5BcHBsaWNhdGlvblByb3RvY29sIn0=")), "protocol") unless @protocol.nil?
  @protocol_version = protocol_version
  Jsii::Type.check_type(@protocol_version, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5BcHBsaWNhdGlvblByb3RvY29sVmVyc2lvbiJ9")), "protocolVersion") unless @protocol_version.nil?
  @slow_start = slow_start
  Jsii::Type.check_type(@slow_start, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "slowStart") unless @slow_start.nil?
  @stickiness_cookie_duration = stickiness_cookie_duration
  Jsii::Type.check_type(@stickiness_cookie_duration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "stickinessCookieDuration") unless @stickiness_cookie_duration.nil?
  @stickiness_cookie_name = stickiness_cookie_name
  Jsii::Type.check_type(@stickiness_cookie_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stickinessCookieName") unless @stickiness_cookie_name.nil?
  @targets = targets
  Jsii::Type.check_type(@targets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLklBcHBsaWNhdGlvbkxvYWRCYWxhbmNlclRhcmdldCJ9LCJraW5kIjoiYXJyYXkifX0=")), "targets") unless @targets.nil?
end

Instance Attribute Details

#cross_zone_enabledBoolean? (readonly)

Note:

Default: - use load balancer configuration

Indicates whether cross zone load balancing is enabled.



69
70
71
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 69

def cross_zone_enabled
  @cross_zone_enabled
end

#deregistration_delayAWSCDK::Duration? (readonly)

Note:

Default: 300

The amount of time for Elastic Load Balancing to wait before deregistering a target.

The range is 0-3600 seconds.

Returns:



76
77
78
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 76

def deregistration_delay
  @deregistration_delay
end

#enable_anomaly_mitigationBoolean? (readonly)

Note:

Default: false

Indicates whether anomaly mitigation is enabled.

Only available when load_balancing_algorithm_type is TargetGroupLoadBalancingAlgorithmType.WEIGHTED_RANDOM



126
127
128
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 126

def enable_anomaly_mitigation
  @enable_anomaly_mitigation
end

#health_checkAWSCDK::ElasticLoadBalancingv2::HealthCheck? (readonly)

Note:

Default: - The default value for each property in this configuration varies depending on the target.

Health check configuration.



82
83
84
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 82

def health_check
  @health_check
end

#ip_address_typeAWSCDK::ElasticLoadBalancingv2::TargetGroupIPAddressType? (readonly)

Note:

Default: undefined - ELB defaults to IPv4

The type of IP addresses of the targets registered with the target group.



87
88
89
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 87

def ip_address_type
  @ip_address_type
end

#load_balancing_algorithm_typeAWSCDK::ElasticLoadBalancingv2::TargetGroupLoadBalancingAlgorithmType? (readonly)

Note:

Default: TargetGroupLoadBalancingAlgorithmType.ROUND_ROBIN

The load balancing algorithm to select targets for routing requests.



131
132
133
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 131

def load_balancing_algorithm_type
  @load_balancing_algorithm_type
end

#multi_value_headers_enabledBoolean? (readonly)

Note:

Default: false

Indicates whether the target group supports multi-value headers.

If the value is true, the request and response headers exchanged between the load balancer and the Lambda function include arrays of values or strings.

Only applicable for Lambda targets.



142
143
144
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 142

def multi_value_headers_enabled
  @multi_value_headers_enabled
end

#portNumeric? (readonly)

Note:

Default: - Determined from protocol if known

The port on which the target receives traffic.

This is not applicable for Lambda targets.

Returns:

  • (Numeric, nil)


149
150
151
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 149

def port
  @port
end

#protocolAWSCDK::ElasticLoadBalancingv2::ApplicationProtocol? (readonly)

Note:

Default: - Determined from port if known

The protocol used for communication with the target.

This is not applicable for Lambda targets.



156
157
158
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 156

def protocol
  @protocol
end

#protocol_versionAWSCDK::ElasticLoadBalancingv2::ApplicationProtocolVersion? (readonly)

Note:

Default: ApplicationProtocolVersion.HTTP1

The protocol version to use.



161
162
163
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 161

def protocol_version
  @protocol_version
end

#slow_startAWSCDK::Duration? (readonly)

Note:

Default: 0

The time period during which the load balancer sends a newly registered target a linearly increasing share of the traffic to the target group.

The range is 30-900 seconds (15 minutes).

Returns:



168
169
170
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 168

def slow_start
  @slow_start
end
Note:

Default: - Stickiness is disabled

The stickiness cookie expiration period.

Setting this value enables load balancer stickiness.

After this period, the cookie is considered stale. The minimum value is 1 second and the maximum value is 7 days (604800 seconds).

Returns:



178
179
180
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 178

def stickiness_cookie_duration
  @stickiness_cookie_duration
end
Note:

Default: - If stickinessCookieDuration is set, a load-balancer generated cookie is used. Otherwise, no stickiness is defined.

The name of an application-based stickiness cookie.

Names that start with the following prefixes are not allowed: AWSALB, AWSALBAPP, and AWSALBTG; they're reserved for use by the load balancer.

Note: stickiness_cookie_name parameter depends on the presence of stickiness_cookie_duration parameter. If stickiness_cookie_duration is not set, stickiness_cookie_name will be omitted.



190
191
192
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 190

def stickiness_cookie_name
  @stickiness_cookie_name
end

#target_group_healthAWSCDK::ElasticLoadBalancingv2::TargetGroupHealth? (readonly)

Note:

Default: - use default configuration

Configuring target group health.



93
94
95
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 93

def target_group_health
  @target_group_health
end

#target_group_nameString? (readonly)

Note:

Default: - Automatically generated.

The name of the target group.

This name must be unique per region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.

Returns:

  • (String, nil)


102
103
104
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 102

def target_group_name
  @target_group_name
end

#target_typeAWSCDK::ElasticLoadBalancingv2::TargetType? (readonly)

Note:

Default: - Determined automatically.

The type of targets registered to this TargetGroup, either IP or Instance.

All targets registered into the group must be of this type. If you register targets to the TargetGroup in the CDK app, the TargetType is determined automatically.



111
112
113
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 111

def target_type
  @target_type
end

#targetsArray<AWSCDK::ElasticLoadBalancingv2::IApplicationLoadBalancerTarget>? (readonly)

Note:

Default: - No targets.

The targets to add to this target group.

Can be Instance, IPAddress, or any self-registering load balancing target. If you use either Instance or IPAddress as targets, all target must be of the same type.



199
200
201
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 199

def targets
  @targets
end

#vpcAWSCDK::EC2::IVPC? (readonly)

Note:

Default: - undefined

The virtual private cloud (VPC).

only if TargetType is Ip or InstanceId

Returns:



118
119
120
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 118

def vpc
  @vpc
end

Class Method Details

.jsii_propertiesObject



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 201

def self.jsii_properties
  {
    :cross_zone_enabled => "crossZoneEnabled",
    :deregistration_delay => "deregistrationDelay",
    :health_check => "healthCheck",
    :ip_address_type => "ipAddressType",
    :target_group_health => "targetGroupHealth",
    :target_group_name => "targetGroupName",
    :target_type => "targetType",
    :vpc => "vpc",
    :enable_anomaly_mitigation => "enableAnomalyMitigation",
    :load_balancing_algorithm_type => "loadBalancingAlgorithmType",
    :multi_value_headers_enabled => "multiValueHeadersEnabled",
    :port => "port",
    :protocol => "protocol",
    :protocol_version => "protocolVersion",
    :slow_start => "slowStart",
    :stickiness_cookie_duration => "stickinessCookieDuration",
    :stickiness_cookie_name => "stickinessCookieName",
    :targets => "targets",
  }
end

Instance Method Details

#to_jsiiObject



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'elastic_load_balancingv2/application_target_group_props.rb', line 224

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "crossZoneEnabled" => @cross_zone_enabled,
    "deregistrationDelay" => @deregistration_delay,
    "healthCheck" => @health_check,
    "ipAddressType" => @ip_address_type,
    "targetGroupHealth" => @target_group_health,
    "targetGroupName" => @target_group_name,
    "targetType" => @target_type,
    "vpc" => @vpc,
    "enableAnomalyMitigation" => @enable_anomaly_mitigation,
    "loadBalancingAlgorithmType" => @load_balancing_algorithm_type,
    "multiValueHeadersEnabled" => @multi_value_headers_enabled,
    "port" => @port,
    "protocol" => @protocol,
    "protocolVersion" => @protocol_version,
    "slowStart" => @slow_start,
    "stickinessCookieDuration" => @stickiness_cookie_duration,
    "stickinessCookieName" => @stickiness_cookie_name,
    "targets" => @targets,
  })
  result.compact
end