Class: AWSCDK::ElasticLoadBalancingv2::NetworkTargetGroupProps

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

Overview

Properties for a new Network 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, port:, connection_termination: nil, preserve_client_ip: nil, protocol: nil, proxy_protocol_v2: nil, targets: nil) ⇒ NetworkTargetGroupProps

Returns a new instance of NetworkTargetGroupProps.

Parameters:

  • cross_zone_enabled (Boolean, nil) (defaults to: nil)

    Indicates whether cross zone load balancing is enabled.

  • deregistration_delay (AWSCDK::Duration, nil) (defaults to: nil)

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

  • health_check (AWSCDK::ElasticLoadBalancingv2::HealthCheck, nil) (defaults to: nil)

    Health check configuration.

  • ip_address_type (AWSCDK::ElasticLoadBalancingv2::TargetGroupIPAddressType, nil) (defaults to: nil)

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

  • target_group_health (AWSCDK::ElasticLoadBalancingv2::TargetGroupHealth, nil) (defaults to: nil)

    Configuring target group health.

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

    The name of the target group.

  • target_type (AWSCDK::ElasticLoadBalancingv2::TargetType, nil) (defaults to: nil)

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

  • vpc (AWSCDK::EC2::IVPC, nil) (defaults to: nil)

    The virtual private cloud (VPC).

  • port (Numeric)

    The port on which the target receives traffic.

  • connection_termination (Boolean, nil) (defaults to: nil)

    Indicates whether the load balancer terminates connections at the end of the deregistration timeout.

  • preserve_client_ip (Boolean, nil) (defaults to: nil)

    Indicates whether client IP preservation is enabled.

  • protocol (AWSCDK::ElasticLoadBalancingv2::Protocol, nil) (defaults to: nil)

    Protocol for target group, expects TCP, TLS, UDP, or TCP_UDP.

  • proxy_protocol_v2 (Boolean, nil) (defaults to: nil)

    Indicates whether Proxy Protocol version 2 is enabled.

  • targets (Array<AWSCDK::ElasticLoadBalancingv2::INetworkLoadBalancerTarget>, nil) (defaults to: nil)

    The targets to add to this target group.



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_props.rb', line 21

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, port:, connection_termination: nil, preserve_client_ip: nil, protocol: nil, proxy_protocol_v2: 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?
  @port = port
  Jsii::Type.check_type(@port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port")
  @connection_termination = connection_termination
  Jsii::Type.check_type(@connection_termination, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "connectionTermination") unless @connection_termination.nil?
  @preserve_client_ip = preserve_client_ip
  Jsii::Type.check_type(@preserve_client_ip, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "preserveClientIp") unless @preserve_client_ip.nil?
  @protocol = protocol
  Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5Qcm90b2NvbCJ9")), "protocol") unless @protocol.nil?
  @proxy_protocol_v2 = proxy_protocol_v2
  Jsii::Type.check_type(@proxy_protocol_v2, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "proxyProtocolV2") unless @proxy_protocol_v2.nil?
  @targets = targets
  Jsii::Type.check_type(@targets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLklOZXR3b3JrTG9hZEJhbGFuY2VyVGFyZ2V0In0sImtpbmQiOiJhcnJheSJ9fQ==")), "targets") unless @targets.nil?
end

Instance Attribute Details

#connection_terminationBoolean? (readonly)

Note:

Default: false

Indicates whether the load balancer terminates connections at the end of the deregistration timeout.

Returns:

  • (Boolean, nil)


115
116
117
# File 'elastic_load_balancingv2/network_target_group_props.rb', line 115

def connection_termination
  @connection_termination
end

#cross_zone_enabledBoolean? (readonly)

Note:

Default: - use load balancer configuration

Indicates whether cross zone load balancing is enabled.



57
58
59
# File 'elastic_load_balancingv2/network_target_group_props.rb', line 57

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:



64
65
66
# File 'elastic_load_balancingv2/network_target_group_props.rb', line 64

def deregistration_delay
  @deregistration_delay
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.



70
71
72
# File 'elastic_load_balancingv2/network_target_group_props.rb', line 70

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.



75
76
77
# File 'elastic_load_balancingv2/network_target_group_props.rb', line 75

def ip_address_type
  @ip_address_type
end

#portNumeric (readonly)

The port on which the target receives traffic.

Returns:

  • (Numeric)


110
111
112
# File 'elastic_load_balancingv2/network_target_group_props.rb', line 110

def port
  @port
end

#preserve_client_ipBoolean? (readonly)

Note:

Default: false if the target group type is IP address and the target group protocol is TCP or TLS. Otherwise, true.

Indicates whether client IP preservation is enabled.

Returns:

  • (Boolean, nil)


120
121
122
# File 'elastic_load_balancingv2/network_target_group_props.rb', line 120

def preserve_client_ip
  @preserve_client_ip
end

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

Note:

Default: - TCP

Protocol for target group, expects TCP, TLS, UDP, or TCP_UDP.



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

def protocol
  @protocol
end

#proxy_protocol_v2Boolean? (readonly)

Note:

Default: false

Indicates whether Proxy Protocol version 2 is enabled.

Returns:

  • (Boolean, nil)


130
131
132
# File 'elastic_load_balancingv2/network_target_group_props.rb', line 130

def proxy_protocol_v2
  @proxy_protocol_v2
end

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

Note:

Default: - use default configuration

Configuring target group health.



81
82
83
# File 'elastic_load_balancingv2/network_target_group_props.rb', line 81

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)


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

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.



99
100
101
# File 'elastic_load_balancingv2/network_target_group_props.rb', line 99

def target_type
  @target_type
end

#targetsArray<AWSCDK::ElasticLoadBalancingv2::INetworkLoadBalancerTarget>? (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.



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

def targets
  @targets
end

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

Note:

Default: - undefined

The virtual private cloud (VPC).

only if TargetType is Ip or InstanceId

Returns:



106
107
108
# File 'elastic_load_balancingv2/network_target_group_props.rb', line 106

def vpc
  @vpc
end

Class Method Details

.jsii_propertiesObject



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'elastic_load_balancingv2/network_target_group_props.rb', line 141

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",
    :port => "port",
    :connection_termination => "connectionTermination",
    :preserve_client_ip => "preserveClientIp",
    :protocol => "protocol",
    :proxy_protocol_v2 => "proxyProtocolV2",
    :targets => "targets",
  }
end

Instance Method Details

#to_jsiiObject



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'elastic_load_balancingv2/network_target_group_props.rb', line 160

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,
    "port" => @port,
    "connectionTermination" => @connection_termination,
    "preserveClientIp" => @preserve_client_ip,
    "protocol" => @protocol,
    "proxyProtocolV2" => @proxy_protocol_v2,
    "targets" => @targets,
  })
  result.compact
end