Class: AWSCDK::ElasticLoadBalancing::LoadBalancerListener

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
elastic_load_balancing/load_balancer_listener.rb

Overview

Add a backend to the load balancer.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(external_port:, allow_connections_from: nil, external_protocol: nil, internal_port: nil, internal_protocol: nil, policy_names: nil, ssl_certificate_arn: nil) ⇒ LoadBalancerListener

Returns a new instance of LoadBalancerListener.

Parameters:

  • external_port (Numeric)

    External listening port.

  • allow_connections_from (Array<AWSCDK::EC2::IConnectable>, nil) (defaults to: nil)

    Allow connections to the load balancer from the given set of connection peers.

  • external_protocol (AWSCDK::ElasticLoadBalancing::LoadBalancingProtocol, nil) (defaults to: nil)

    What public protocol to use for load balancing.

  • internal_port (Numeric, nil) (defaults to: nil)

    Instance listening port.

  • internal_protocol (AWSCDK::ElasticLoadBalancing::LoadBalancingProtocol, nil) (defaults to: nil)

    What public protocol to use for load balancing.

  • policy_names (Array<String>, nil) (defaults to: nil)

    SSL policy names.

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

    the ARN of the SSL certificate.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'elastic_load_balancing/load_balancer_listener.rb', line 14

def initialize(external_port:, allow_connections_from: nil, external_protocol: nil, internal_port: nil, internal_protocol: nil, policy_names: nil, ssl_certificate_arn: nil)
  @external_port = external_port
  Jsii::Type.check_type(@external_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "externalPort")
  @allow_connections_from = allow_connections_from
  Jsii::Type.check_type(@allow_connections_from, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSUNvbm5lY3RhYmxlIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "allowConnectionsFrom") unless @allow_connections_from.nil?
  @external_protocol = external_protocol
  Jsii::Type.check_type(@external_protocol, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmcuTG9hZEJhbGFuY2luZ1Byb3RvY29sIn0=")), "externalProtocol") unless @external_protocol.nil?
  @internal_port = internal_port
  Jsii::Type.check_type(@internal_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "internalPort") unless @internal_port.nil?
  @internal_protocol = internal_protocol
  Jsii::Type.check_type(@internal_protocol, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmcuTG9hZEJhbGFuY2luZ1Byb3RvY29sIn0=")), "internalProtocol") unless @internal_protocol.nil?
  @policy_names = policy_names
  Jsii::Type.check_type(@policy_names, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "policyNames") unless @policy_names.nil?
  @ssl_certificate_arn = ssl_certificate_arn
  Jsii::Type.check_type(@ssl_certificate_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sslCertificateArn") unless @ssl_certificate_arn.nil?
end

Instance Attribute Details

#allow_connections_fromArray<AWSCDK::EC2::IConnectable>? (readonly)

Note:

Default: Anywhere

Allow connections to the load balancer from the given set of connection peers.

By default, connections will be allowed from anywhere. Set this to an empty list to deny connections, or supply a custom list of peers to allow connections from (IP ranges or security groups).

Returns:



43
44
45
# File 'elastic_load_balancing/load_balancer_listener.rb', line 43

def allow_connections_from
  @allow_connections_from
end

#external_portNumeric (readonly)

External listening port.

Returns:

  • (Numeric)


34
35
36
# File 'elastic_load_balancing/load_balancer_listener.rb', line 34

def external_port
  @external_port
end

#external_protocolAWSCDK::ElasticLoadBalancing::LoadBalancingProtocol? (readonly)

What public protocol to use for load balancing.

Either 'tcp', 'ssl', 'http' or 'https'.

May be omitted if the external port is either 80 or 443.



51
52
53
# File 'elastic_load_balancing/load_balancer_listener.rb', line 51

def external_protocol
  @external_protocol
end

#internal_portNumeric? (readonly)

Note:

Default: externalPort

Instance listening port.

Same as the externalPort if not specified.

Returns:

  • (Numeric, nil)


58
59
60
# File 'elastic_load_balancing/load_balancer_listener.rb', line 58

def internal_port
  @internal_port
end

#internal_protocolAWSCDK::ElasticLoadBalancing::LoadBalancingProtocol? (readonly)

What public protocol to use for load balancing.

Either 'tcp', 'ssl', 'http' or 'https'.

May be omitted if the internal port is either 80 or 443.

The instance protocol is 'tcp' if the front-end protocol is 'tcp' or 'ssl', the instance protocol is 'http' if the front-end protocol is 'https'.



70
71
72
# File 'elastic_load_balancing/load_balancer_listener.rb', line 70

def internal_protocol
  @internal_protocol
end

#policy_namesArray<String>? (readonly)

SSL policy names.

Returns:

  • (Array<String>, nil)


74
75
76
# File 'elastic_load_balancing/load_balancer_listener.rb', line 74

def policy_names
  @policy_names
end

#ssl_certificate_arnString? (readonly)

Note:

Default: - none

the ARN of the SSL certificate.

Returns:

  • (String, nil)


79
80
81
# File 'elastic_load_balancing/load_balancer_listener.rb', line 79

def ssl_certificate_arn
  @ssl_certificate_arn
end

Class Method Details

.jsii_propertiesObject



81
82
83
84
85
86
87
88
89
90
91
# File 'elastic_load_balancing/load_balancer_listener.rb', line 81

def self.jsii_properties
  {
    :external_port => "externalPort",
    :allow_connections_from => "allowConnectionsFrom",
    :external_protocol => "externalProtocol",
    :internal_port => "internalPort",
    :internal_protocol => "internalProtocol",
    :policy_names => "policyNames",
    :ssl_certificate_arn => "sslCertificateArn",
  }
end

Instance Method Details

#to_jsiiObject



93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'elastic_load_balancing/load_balancer_listener.rb', line 93

def to_jsii
  result = {}
  result.merge!({
    "externalPort" => @external_port,
    "allowConnectionsFrom" => @allow_connections_from,
    "externalProtocol" => @external_protocol,
    "internalPort" => @internal_port,
    "internalProtocol" => @internal_protocol,
    "policyNames" => @policy_names,
    "sslCertificateArn" => @ssl_certificate_arn,
  })
  result.compact
end