Class: AWSCDK::ECSPatterns::NetworkLoadBalancerProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ecs_patterns/network_load_balancer_props.rb

Overview

Properties to define an network load balancer.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(listeners:, name:, domain_name: nil, domain_zone: nil, public_load_balancer: nil) ⇒ NetworkLoadBalancerProps

Returns a new instance of NetworkLoadBalancerProps.

Parameters:

  • listeners (Array<AWSCDK::ECSPatterns::NetworkListenerProps>)

    Listeners (at least one listener) attached to this load balancer.

  • name (String)

    Name of the load balancer.

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

    The domain name for the service, e.g. "api.example.com.".

  • domain_zone (AWSCDK::Route53::IHostedZone, nil) (defaults to: nil)

    The Route53 hosted zone for the domain, e.g. "example.com.".

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

    Determines whether the Load Balancer will be internet-facing.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'ecs_patterns/network_load_balancer_props.rb', line 12

def initialize(listeners:, name:, domain_name: nil, domain_zone: nil, public_load_balancer: nil)
  @listeners = listeners.is_a?(Array) ? listeners.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECSPatterns::NetworkListenerProps.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : listeners
  Jsii::Type.check_type(@listeners, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3NfcGF0dGVybnMuTmV0d29ya0xpc3RlbmVyUHJvcHMifSwia2luZCI6ImFycmF5In19")), "listeners")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @domain_name = domain_name
  Jsii::Type.check_type(@domain_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "domainName") unless @domain_name.nil?
  @domain_zone = domain_zone
  Jsii::Type.check_type(@domain_zone, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfcm91dGU1My5JSG9zdGVkWm9uZSJ9")), "domainZone") unless @domain_zone.nil?
  @public_load_balancer = public_load_balancer
  Jsii::Type.check_type(@public_load_balancer, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "publicLoadBalancer") unless @public_load_balancer.nil?
end

Instance Attribute Details

#domain_nameString? (readonly)

Note:

Default: - No domain name.

The domain name for the service, e.g. "api.example.com.".

Returns:

  • (String, nil)


38
39
40
# File 'ecs_patterns/network_load_balancer_props.rb', line 38

def domain_name
  @domain_name
end

#domain_zoneAWSCDK::Route53::IHostedZone? (readonly)

Note:

Default: - No Route53 hosted domain zone.

The Route53 hosted zone for the domain, e.g. "example.com.".



43
44
45
# File 'ecs_patterns/network_load_balancer_props.rb', line 43

def domain_zone
  @domain_zone
end

#listenersArray<AWSCDK::ECSPatterns::NetworkListenerProps> (readonly)

Note:

Default: - none

Listeners (at least one listener) attached to this load balancer.



29
30
31
# File 'ecs_patterns/network_load_balancer_props.rb', line 29

def listeners
  @listeners
end

#nameString (readonly)

Name of the load balancer.

Returns:

  • (String)


33
34
35
# File 'ecs_patterns/network_load_balancer_props.rb', line 33

def name
  @name
end

#public_load_balancerBoolean? (readonly)

Note:

Default: true

Determines whether the Load Balancer will be internet-facing.

Returns:

  • (Boolean, nil)


48
49
50
# File 'ecs_patterns/network_load_balancer_props.rb', line 48

def public_load_balancer
  @public_load_balancer
end

Class Method Details

.jsii_propertiesObject



50
51
52
53
54
55
56
57
58
# File 'ecs_patterns/network_load_balancer_props.rb', line 50

def self.jsii_properties
  {
    :listeners => "listeners",
    :name => "name",
    :domain_name => "domainName",
    :domain_zone => "domainZone",
    :public_load_balancer => "publicLoadBalancer",
  }
end

Instance Method Details

#to_jsiiObject



60
61
62
63
64
65
66
67
68
69
70
# File 'ecs_patterns/network_load_balancer_props.rb', line 60

def to_jsii
  result = {}
  result.merge!({
    "listeners" => @listeners,
    "name" => @name,
    "domainName" => @domain_name,
    "domainZone" => @domain_zone,
    "publicLoadBalancer" => @public_load_balancer,
  })
  result.compact
end