Class: AWSCDK::ElasticLoadBalancingv2::NetworkListenerProps

Inherits:
BaseNetworkListenerProps
  • Object
show all
Defined in:
elastic_load_balancingv2/network_listener_props.rb

Overview

Properties for a Network Listener attached to a Load Balancer.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(port:, alpn_policy: nil, certificates: nil, default_action: nil, default_target_groups: nil, protocol: nil, ssl_policy: nil, tcp_idle_timeout: nil, load_balancer:) ⇒ NetworkListenerProps

Returns a new instance of NetworkListenerProps.

Parameters:



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

def initialize(port:, alpn_policy: nil, certificates: nil, default_action: nil, default_target_groups: nil, protocol: nil, ssl_policy: nil, tcp_idle_timeout: nil, load_balancer:)
  @port = port
  Jsii::Type.check_type(@port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port")
  @alpn_policy = alpn_policy
  Jsii::Type.check_type(@alpn_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5BbHBuUG9saWN5In0=")), "alpnPolicy") unless @alpn_policy.nil?
  @certificates = certificates
  Jsii::Type.check_type(@certificates, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLklMaXN0ZW5lckNlcnRpZmljYXRlIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "certificates") unless @certificates.nil?
  @default_action = default_action
  Jsii::Type.check_type(@default_action, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5OZXR3b3JrTGlzdGVuZXJBY3Rpb24ifQ==")), "defaultAction") unless @default_action.nil?
  @default_target_groups = default_target_groups
  Jsii::Type.check_type(@default_target_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLklOZXR3b3JrVGFyZ2V0R3JvdXAifSwia2luZCI6ImFycmF5In19")), "defaultTargetGroups") unless @default_target_groups.nil?
  @protocol = protocol
  Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5Qcm90b2NvbCJ9")), "protocol") unless @protocol.nil?
  @ssl_policy = ssl_policy
  Jsii::Type.check_type(@ssl_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5Tc2xQb2xpY3kifQ==")), "sslPolicy") unless @ssl_policy.nil?
  @tcp_idle_timeout = tcp_idle_timeout
  Jsii::Type.check_type(@tcp_idle_timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "tcpIdleTimeout") unless @tcp_idle_timeout.nil?
  @load_balancer = load_balancer
  Jsii::Type.check_type(@load_balancer, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5JTmV0d29ya0xvYWRCYWxhbmNlciJ9")), "loadBalancer")
end

Instance Attribute Details

#alpn_policyAWSCDK::ElasticLoadBalancingv2::AlpnPolicy? (readonly)

Note:

Default: - None

Application-Layer Protocol Negotiation (ALPN) is a TLS extension that is sent on the initial TLS handshake hello messages.

ALPN enables the application layer to negotiate which protocols should be used over a secure connection, such as HTTP/1 and HTTP/2.

Can only be specified together with Protocol TLS.



49
50
51
# File 'elastic_load_balancingv2/network_listener_props.rb', line 49

def alpn_policy
  @alpn_policy
end

#certificatesArray<AWSCDK::ElasticLoadBalancingv2::IListenerCertificate>? (readonly)

Note:

Default: - No certificates.

Certificate list of ACM cert ARNs.

You must provide exactly one certificate if the listener protocol is HTTPS or TLS.



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

def certificates
  @certificates
end

#default_actionAWSCDK::ElasticLoadBalancingv2::NetworkListenerAction? (readonly)

Note:

Default: - None.

Default action to take for requests to this listener.

This allows full control of the default Action of the load balancer, including weighted forwarding. See the NetworkListenerAction class for all options.

Cannot be specified together with default_target_groups.



67
68
69
# File 'elastic_load_balancingv2/network_listener_props.rb', line 67

def default_action
  @default_action
end

#default_target_groupsArray<AWSCDK::ElasticLoadBalancingv2::INetworkTargetGroup>? (readonly)

Note:

Default: - None.

Default target groups to load balance to.

All target groups will be load balanced to with equal weight and without stickiness. For a more complex configuration than that, use either default_action or add_action().

Cannot be specified together with default_action.



78
79
80
# File 'elastic_load_balancingv2/network_listener_props.rb', line 78

def default_target_groups
  @default_target_groups
end

#load_balancerAWSCDK::ElasticLoadBalancingv2::INetworkLoadBalancer (readonly)

The load balancer to attach this listener to.



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

def load_balancer
  @load_balancer
end

#portNumeric (readonly)

The port on which the listener listens for requests.

Returns:

  • (Numeric)


40
41
42
# File 'elastic_load_balancingv2/network_listener_props.rb', line 40

def port
  @port
end

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

Note:

Default: - TLS if certificates are provided. TCP otherwise.

Protocol for listener, expects TCP, TLS, UDP, or TCP_UDP.



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

def protocol
  @protocol
end

#ssl_policyAWSCDK::ElasticLoadBalancingv2::SSLPolicy? (readonly)

Note:

Default: - Current predefined security policy.

SSL Policy.



88
89
90
# File 'elastic_load_balancingv2/network_listener_props.rb', line 88

def ssl_policy
  @ssl_policy
end

#tcp_idle_timeoutAWSCDK::Duration? (readonly)

Note:

Default: Duration.seconds(350)

The load balancer TCP idle timeout.

Returns:



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

def tcp_idle_timeout
  @tcp_idle_timeout
end

Class Method Details

.jsii_propertiesObject



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

def self.jsii_properties
  {
    :port => "port",
    :alpn_policy => "alpnPolicy",
    :certificates => "certificates",
    :default_action => "defaultAction",
    :default_target_groups => "defaultTargetGroups",
    :protocol => "protocol",
    :ssl_policy => "sslPolicy",
    :tcp_idle_timeout => "tcpIdleTimeout",
    :load_balancer => "loadBalancer",
  }
end

Instance Method Details

#to_jsiiObject



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'elastic_load_balancingv2/network_listener_props.rb', line 113

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "port" => @port,
    "alpnPolicy" => @alpn_policy,
    "certificates" => @certificates,
    "defaultAction" => @default_action,
    "defaultTargetGroups" => @default_target_groups,
    "protocol" => @protocol,
    "sslPolicy" => @ssl_policy,
    "tcpIdleTimeout" => @tcp_idle_timeout,
    "loadBalancer" => @load_balancer,
  })
  result.compact
end