Class: AWSCDK::ElasticLoadBalancingv2::NetworkTargetGroup
- Inherits:
-
TargetGroupBase
- Object
- TargetGroupBase
- AWSCDK::ElasticLoadBalancingv2::NetworkTargetGroup
- Includes:
- INetworkTargetGroup
- Defined in:
- elastic_load_balancingv2/network_target_group.rb
Overview
Define a Network Target Group.
Class Method Summary collapse
-
.from_target_group_attributes(scope, id, attrs) ⇒ AWSCDK::ElasticLoadBalancingv2::INetworkTargetGroup
Import an existing target group.
- .jsii_overridable_methods ⇒ Object
-
.PROPERTY_INJECTION_ID ⇒ String
Uniquely identifies this class.
Instance Method Summary collapse
-
#add_load_balancer_target(props) ⇒ void
Register the given load balancing target as part of this group.
-
#add_target(*targets) ⇒ void
Add a load balancing target to this target group.
-
#configure_health_check(health_check) ⇒ void
Set/replace the target group's health check.
-
#default_port ⇒ Numeric
Default port configured for members of this target group.
-
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
-
#first_load_balancer_full_name ⇒ String
Full name of first load balancer.
-
#health_check ⇒ AWSCDK::ElasticLoadBalancingv2::HealthCheck
Health check for the members of this target group.
- #health_check=(value) ⇒ Object
-
#initialize(scope, id, props) ⇒ NetworkTargetGroup
constructor
A new instance of NetworkTargetGroup.
-
#is_network_target_group ⇒ Boolean
Indicates that this is a Network Target Group.
-
#load_balancer_arns ⇒ String
A token representing a list of ARNs of the load balancers that route traffic to this target group.
-
#load_balancer_attached ⇒ Constructs::IDependable
List of constructs that need to be depended on to ensure the TargetGroup is associated to a load balancer.
-
#load_balancer_attached_dependencies ⇒ Constructs::DependencyGroup
Configurable dependable with all resources that lead to load balancer attachment.
-
#metric_healthy_host_count(props = nil) ⇒ AWSCDK::CloudWatch::Metric
deprecated
Deprecated.
Use
NetworkTargetGroup.metrics.healthyHostCountinstead -
#metric_un_healthy_host_count(props = nil) ⇒ AWSCDK::CloudWatch::Metric
deprecated
Deprecated.
Use
NetworkTargetGroup.metrics.healthyHostCountinstead -
#metrics ⇒ AWSCDK::ElasticLoadBalancingv2::INetworkTargetGroupMetrics
All metrics available for this target group.
-
#node ⇒ Constructs::Node
The tree node.
-
#register_listener(listener) ⇒ void
Register a listener that is load balancing to this target group.
-
#set_attribute(key, value = nil) ⇒ void
Set a non-standard attribute on the target group.
-
#target_group_arn ⇒ String
The ARN of the target group.
-
#target_group_full_name ⇒ String
The full name of the target group.
-
#target_group_load_balancer_arns ⇒ Array<String>
ARNs of load balancers load balancing to this TargetGroup.
-
#target_group_name ⇒ String
The name of the target group.
-
#target_group_ref ⇒ AWSCDK::Interfaces::AWSElasticloadbalancingv2::TargetGroupReference
A reference to this target group.
-
#target_type ⇒ AWSCDK::ElasticLoadBalancingv2::TargetType?
The types of the directly registered members of this target group.
- #target_type=(value) ⇒ Object
-
#to_string ⇒ String
Returns a string representation of this construct.
- #validate_health_check ⇒ Array<String>
- #validate_target_group ⇒ Array<String>
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props) ⇒ NetworkTargetGroup
Returns a new instance of NetworkTargetGroup.
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.
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_methods ⇒ Object
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_ID ⇒ String
Uniquely identifies this class.
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.
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_port ⇒ Numeric
Default port configured for members of this target group.
76 77 78 |
# File 'elastic_load_balancingv2/network_target_group.rb', line 76 def default_port() jsii_get_property("defaultPort") end |
#env ⇒ AWSCDK::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_name ⇒ String
Full name of first load balancer.
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_check ⇒ AWSCDK::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_group ⇒ Boolean
Indicates that this is a Network Target Group.
Will always return true, but is necessary to prevent accidental structural equality in TypeScript.
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_arns ⇒ String
A token representing a list of ARNs of the load balancers that route traffic to this target group.
97 98 99 |
# File 'elastic_load_balancingv2/network_target_group.rb', line 97 def load_balancer_arns() jsii_get_property("loadBalancerArns") end |
#load_balancer_attached ⇒ Constructs::IDependable
List of constructs that need to be depended on to ensure the TargetGroup is associated to a load balancer.
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_dependencies ⇒ Constructs::DependencyGroup
Configurable dependable with all resources that lead to load balancer attachment.
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
Use NetworkTargetGroup.metrics.healthyHostCount instead
Default: Average over 5 minutes
The number of targets that are considered healthy.
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
Use NetworkTargetGroup.metrics.healthyHostCount instead
Default: Average over 5 minutes
The number of targets that are considered unhealthy.
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 |
#metrics ⇒ AWSCDK::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 |
#node ⇒ Constructs::Node
The tree 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_arn ⇒ String
The ARN of the target group.
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_name ⇒ String
The full name of the target group.
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_arns ⇒ Array<String>
ARNs of load balancers load balancing to this TargetGroup.
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_name ⇒ String
The name of the target group.
139 140 141 |
# File 'elastic_load_balancingv2/network_target_group.rb', line 139 def target_group_name() jsii_get_property("targetGroupName") end |
#target_group_ref ⇒ AWSCDK::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_type ⇒ AWSCDK::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_string ⇒ String
Returns a string representation of this construct.
202 203 204 |
# File 'elastic_load_balancingv2/network_target_group.rb', line 202 def to_string() jsii_call_method("toString", []) end |
#validate_health_check ⇒ 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_group ⇒ 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.
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 |