Class: AWSCDK::ElasticLoadBalancingv2::AddNetworkTargetsProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
elastic_load_balancingv2/add_network_targets_props.rb

Overview

Properties for adding new network targets to a listener.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(port:, deregistration_delay: nil, health_check: nil, preserve_client_ip: nil, protocol: nil, proxy_protocol_v2: nil, target_group_name: nil, targets: nil) ⇒ AddNetworkTargetsProps

Returns a new instance of AddNetworkTargetsProps.

Parameters:

  • port (Numeric)

    The port on which the target receives traffic.

  • 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.

  • 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.

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

    The name of the target group.

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

    The targets to add to this target group.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'elastic_load_balancingv2/add_network_targets_props.rb', line 15

def initialize(port:, deregistration_delay: nil, health_check: nil, preserve_client_ip: nil, protocol: nil, proxy_protocol_v2: nil, target_group_name: nil, targets: nil)
  @port = port
  Jsii::Type.check_type(@port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port")
  @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?
  @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?
  @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?
  @targets = targets
  Jsii::Type.check_type(@targets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLklOZXR3b3JrTG9hZEJhbGFuY2VyVGFyZ2V0In0sImtpbmQiOiJhcnJheSJ9fQ==")), "targets") unless @targets.nil?
end

Instance Attribute Details

#deregistration_delayAWSCDK::Duration? (readonly)

Note:

Default: Duration.minutes(5)

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

The range is 0-3600 seconds.

Returns:



45
46
47
# File 'elastic_load_balancingv2/add_network_targets_props.rb', line 45

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.



51
52
53
# File 'elastic_load_balancingv2/add_network_targets_props.rb', line 51

def health_check
  @health_check
end

#portNumeric (readonly)

Note:

Default: Determined from protocol if known

The port on which the target receives traffic.

Returns:

  • (Numeric)


38
39
40
# File 'elastic_load_balancingv2/add_network_targets_props.rb', line 38

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)


56
57
58
# File 'elastic_load_balancingv2/add_network_targets_props.rb', line 56

def preserve_client_ip
  @preserve_client_ip
end

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

Note:

Default: - inherits the protocol of the listener

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



61
62
63
# File 'elastic_load_balancingv2/add_network_targets_props.rb', line 61

def protocol
  @protocol
end

#proxy_protocol_v2Boolean? (readonly)

Note:

Default: false

Indicates whether Proxy Protocol version 2 is enabled.

Returns:

  • (Boolean, nil)


66
67
68
# File 'elastic_load_balancingv2/add_network_targets_props.rb', line 66

def proxy_protocol_v2
  @proxy_protocol_v2
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)


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

def target_group_name
  @target_group_name
end

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

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.



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

def targets
  @targets
end

Class Method Details

.jsii_propertiesObject



85
86
87
88
89
90
91
92
93
94
95
96
# File 'elastic_load_balancingv2/add_network_targets_props.rb', line 85

def self.jsii_properties
  {
    :port => "port",
    :deregistration_delay => "deregistrationDelay",
    :health_check => "healthCheck",
    :preserve_client_ip => "preserveClientIp",
    :protocol => "protocol",
    :proxy_protocol_v2 => "proxyProtocolV2",
    :target_group_name => "targetGroupName",
    :targets => "targets",
  }
end

Instance Method Details

#to_jsiiObject



98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'elastic_load_balancingv2/add_network_targets_props.rb', line 98

def to_jsii
  result = {}
  result.merge!({
    "port" => @port,
    "deregistrationDelay" => @deregistration_delay,
    "healthCheck" => @health_check,
    "preserveClientIp" => @preserve_client_ip,
    "protocol" => @protocol,
    "proxyProtocolV2" => @proxy_protocol_v2,
    "targetGroupName" => @target_group_name,
    "targets" => @targets,
  })
  result.compact
end