Class: AWSCDK::ElasticLoadBalancingv2::NetworkTargetGroup

Inherits:
TargetGroupBase
  • Object
show all
Includes:
INetworkTargetGroup
Defined in:
elastic_load_balancingv2/network_target_group.rb

Overview

Define a Network Target Group.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props) ⇒ NetworkTargetGroup

Returns a new instance of NetworkTargetGroup.

Parameters:



12
13
14
15
16
17
18
# File 'elastic_load_balancingv2/network_target_group.rb', line 12

def initialize(scope, id, props)
  props = props.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::NetworkTargetGroupProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5OZXR3b3JrVGFyZ2V0R3JvdXBQcm9wcyJ9")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.from_target_group_attributes(scope, id, attrs) ⇒ AWSCDK::ElasticLoadBalancingv2::INetworkTargetGroup

Import an existing target group.

Parameters:

Returns:



58
59
60
61
62
63
64
# File 'elastic_load_balancingv2/network_target_group.rb', line 58

def self.from_target_group_attributes(scope, id, attrs)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  attrs = attrs.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::TargetGroupAttributes.new(**attrs.transform_keys(&:to_sym)) : attrs
  Jsii::Type.check_type(attrs, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5UYXJnZXRHcm91cEF0dHJpYnV0ZXMifQ==")), "attrs")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_elasticloadbalancingv2.NetworkTargetGroup", "fromTargetGroupAttributes", [scope, id, attrs])
end

.jsii_overridable_methodsObject



20
21
22
23
24
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
# File 'elastic_load_balancingv2/network_target_group.rb', line 20

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :default_port => { kind: :property, name: "defaultPort", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :first_load_balancer_full_name => { kind: :property, name: "firstLoadBalancerFullName", is_optional: false },
    :load_balancer_arns => { kind: :property, name: "loadBalancerArns", is_optional: false },
    :load_balancer_attached => { kind: :property, name: "loadBalancerAttached", is_optional: false },
    :load_balancer_attached_dependencies => { kind: :property, name: "loadBalancerAttachedDependencies", is_optional: false },
    :target_group_arn => { kind: :property, name: "targetGroupArn", is_optional: false },
    :target_group_full_name => { kind: :property, name: "targetGroupFullName", is_optional: false },
    :target_group_load_balancer_arns => { kind: :property, name: "targetGroupLoadBalancerArns", is_optional: false },
    :target_group_name => { kind: :property, name: "targetGroupName", is_optional: false },
    :target_group_ref => { kind: :property, name: "targetGroupRef", is_optional: false },
    :health_check => { kind: :property, name: "healthCheck", is_optional: false },
    :target_type => { kind: :property, name: "targetType", is_optional: true },
    :is_network_target_group => { kind: :property, name: "isNetworkTargetGroup", is_optional: false },
    :metrics => { kind: :property, name: "metrics", is_optional: false },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :add_load_balancer_target => { kind: :method, name: "addLoadBalancerTarget", is_optional: false },
    :configure_health_check => { kind: :method, name: "configureHealthCheck", is_optional: false },
    :set_attribute => { kind: :method, name: "setAttribute", is_optional: false },
    :validate_health_check => { kind: :method, name: "validateHealthCheck", is_optional: false },
    :validate_target_group => { kind: :method, name: "validateTargetGroup", is_optional: false },
    :add_target => { kind: :method, name: "addTarget", is_optional: false },
    :metric_healthy_host_count => { kind: :method, name: "metricHealthyHostCount", is_optional: false },
    :metric_un_healthy_host_count => { kind: :method, name: "metricUnHealthyHostCount", is_optional: false },
    :register_listener => { kind: :method, name: "registerListener", is_optional: false },
  }
end

.PROPERTY_INJECTION_IDString

Uniquely identifies this class.

Returns:

  • (String)


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

def self.PROPERTY_INJECTION_ID()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_elasticloadbalancingv2.NetworkTargetGroup", "PROPERTY_INJECTION_ID")
end

Instance Method Details

#add_load_balancer_target(props) ⇒ void

This method returns an undefined value.

Register the given load balancing target as part of this group.



226
227
228
229
230
# File 'elastic_load_balancingv2/network_target_group.rb', line 226

def add_load_balancer_target(props)
  props = props.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::LoadBalancerTargetProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5Mb2FkQmFsYW5jZXJUYXJnZXRQcm9wcyJ9")), "props")
  jsii_call_method("addLoadBalancerTarget", [props])
end

#add_target(*targets) ⇒ void

This method returns an undefined value.

Add a load balancing target to this target group.



268
269
270
271
272
273
# File 'elastic_load_balancingv2/network_target_group.rb', line 268

def add_target(*targets)
  targets.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5JTmV0d29ya0xvYWRCYWxhbmNlclRhcmdldCJ9")), "targets[#{index}]")
  end
  jsii_call_method("addTarget", [*targets])
end

#configure_health_check(health_check) ⇒ void

This method returns an undefined value.

Set/replace the target group's health check.

Parameters:



236
237
238
239
240
# File 'elastic_load_balancingv2/network_target_group.rb', line 236

def configure_health_check(health_check)
  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")
  jsii_call_method("configureHealthCheck", [health_check])
end

#default_portNumeric

Default port configured for members of this target group.

Returns:

  • (Numeric)


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

def default_port()
  jsii_get_property("defaultPort")
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.



83
84
85
# File 'elastic_load_balancingv2/network_target_group.rb', line 83

def env()
  jsii_get_property("env")
end

#first_load_balancer_full_nameString

Full name of first load balancer.

Returns:

  • (String)


90
91
92
# File 'elastic_load_balancingv2/network_target_group.rb', line 90

def first_load_balancer_full_name()
  jsii_get_property("firstLoadBalancerFullName")
end

#health_checkAWSCDK::ElasticLoadBalancingv2::HealthCheck

Health check for the members of this target group.



153
154
155
# File 'elastic_load_balancingv2/network_target_group.rb', line 153

def health_check()
  jsii_get_property("healthCheck")
end

#health_check=(value) ⇒ Object



157
158
159
160
161
# File 'elastic_load_balancingv2/network_target_group.rb', line 157

def health_check=(value)
  value = value.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::HealthCheck.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5IZWFsdGhDaGVjayJ9")), "healthCheck")
  jsii_set_property("healthCheck", value)
end

#is_network_target_groupBoolean

Indicates that this is a Network Target Group.

Will always return true, but is necessary to prevent accidental structural equality in TypeScript.

Returns:

  • (Boolean)


188
189
190
# File 'elastic_load_balancingv2/network_target_group.rb', line 188

def is_network_target_group()
  jsii_get_property("isNetworkTargetGroup")
end

#load_balancer_arnsString

A token representing a list of ARNs of the load balancers that route traffic to this target group.

Returns:

  • (String)


97
98
99
# File 'elastic_load_balancingv2/network_target_group.rb', line 97

def load_balancer_arns()
  jsii_get_property("loadBalancerArns")
end

#load_balancer_attachedConstructs::IDependable

List of constructs that need to be depended on to ensure the TargetGroup is associated to a load balancer.

Returns:

  • (Constructs::IDependable)


104
105
106
# File 'elastic_load_balancingv2/network_target_group.rb', line 104

def load_balancer_attached()
  jsii_get_property("loadBalancerAttached")
end

#load_balancer_attached_dependenciesConstructs::DependencyGroup

Configurable dependable with all resources that lead to load balancer attachment.

Returns:

  • (Constructs::DependencyGroup)


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

def load_balancer_attached_dependencies()
  jsii_get_property("loadBalancerAttachedDependencies")
end

#metric_healthy_host_count(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Deprecated.

Use NetworkTargetGroup.metrics.healthyHostCount instead

Note:

Default: Average over 5 minutes

The number of targets that are considered healthy.

Parameters:

Returns:



281
282
283
284
285
# File 'elastic_load_balancingv2/network_target_group.rb', line 281

def metric_healthy_host_count(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricHealthyHostCount", [props])
end

#metric_un_healthy_host_count(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Deprecated.

Use NetworkTargetGroup.metrics.healthyHostCount instead

Note:

Default: Average over 5 minutes

The number of targets that are considered unhealthy.

Parameters:

Returns:



293
294
295
296
297
# File 'elastic_load_balancingv2/network_target_group.rb', line 293

def metric_un_healthy_host_count(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricUnHealthyHostCount", [props])
end

#metricsAWSCDK::ElasticLoadBalancingv2::INetworkTargetGroupMetrics

All metrics available for this target group.



195
196
197
# File 'elastic_load_balancingv2/network_target_group.rb', line 195

def metrics()
  jsii_get_property("metrics")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


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

def node()
  jsii_get_property("node")
end

#register_listener(listener) ⇒ void

This method returns an undefined value.

Register a listener that is load balancing to this target group.

Don't call this directly. It will be called by listeners.



305
306
307
308
# File 'elastic_load_balancingv2/network_target_group.rb', line 305

def register_listener(listener)
  Jsii::Type.check_type(listener, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5JTmV0d29ya0xpc3RlbmVyUmVmIn0=")), "listener")
  jsii_call_method("registerListener", [listener])
end

#set_attribute(key, value = nil) ⇒ void

This method returns an undefined value.

Set a non-standard attribute on the target group.



248
249
250
251
252
# File 'elastic_load_balancingv2/network_target_group.rb', line 248

def set_attribute(key, value = nil)
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value") unless value.nil?
  jsii_call_method("setAttribute", [key, value])
end

#target_group_arnString

The ARN of the target group.

Returns:

  • (String)


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

def target_group_arn()
  jsii_get_property("targetGroupArn")
end

#target_group_full_nameString

The full name of the target group.

Returns:

  • (String)


125
126
127
# File 'elastic_load_balancingv2/network_target_group.rb', line 125

def target_group_full_name()
  jsii_get_property("targetGroupFullName")
end

#target_group_load_balancer_arnsArray<String>

ARNs of load balancers load balancing to this TargetGroup.

Returns:

  • (Array<String>)


132
133
134
# File 'elastic_load_balancingv2/network_target_group.rb', line 132

def target_group_load_balancer_arns()
  jsii_get_property("targetGroupLoadBalancerArns")
end

#target_group_nameString

The name of the target group.

Returns:

  • (String)


139
140
141
# File 'elastic_load_balancingv2/network_target_group.rb', line 139

def target_group_name()
  jsii_get_property("targetGroupName")
end

#target_group_refAWSCDK::Interfaces::AWSElasticloadbalancingv2::TargetGroupReference

A reference to this target group.



146
147
148
# File 'elastic_load_balancingv2/network_target_group.rb', line 146

def target_group_ref()
  jsii_get_property("targetGroupRef")
end

#target_typeAWSCDK::ElasticLoadBalancingv2::TargetType?

The types of the directly registered members of this target group.



166
167
168
# File 'elastic_load_balancingv2/network_target_group.rb', line 166

def target_type()
  jsii_get_property("targetType")
end

#target_type=(value) ⇒ Object



170
171
172
173
# File 'elastic_load_balancingv2/network_target_group.rb', line 170

def target_type=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5UYXJnZXRUeXBlIn0=")), "targetType") unless value.nil?
  jsii_set_property("targetType", value)
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


202
203
204
# File 'elastic_load_balancingv2/network_target_group.rb', line 202

def to_string()
  jsii_call_method("toString", [])
end

#validate_health_checkArray<String>

Returns:

  • (Array<String>)


255
256
257
# File 'elastic_load_balancingv2/network_target_group.rb', line 255

def validate_health_check()
  jsii_call_method("validateHealthCheck", [])
end

#validate_target_groupArray<String>

Returns:

  • (Array<String>)


260
261
262
# File 'elastic_load_balancingv2/network_target_group.rb', line 260

def validate_target_group()
  jsii_call_method("validateTargetGroup", [])
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



215
216
217
218
219
220
# File 'elastic_load_balancingv2/network_target_group.rb', line 215

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end