Class: AWSCDK::ElasticLoadBalancingv2::BaseLoadBalancerProps

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

Overview

Shared properties of both Application and Network Load Balancers.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vpc:, cross_zone_enabled: nil, deletion_protection: nil, deny_all_igw_traffic: nil, internet_facing: nil, load_balancer_name: nil, minimum_capacity_unit: nil, vpc_subnets: nil) ⇒ BaseLoadBalancerProps

Returns a new instance of BaseLoadBalancerProps.

Parameters:

  • vpc (AWSCDK::EC2::IVPC)

    The VPC network to place the load balancer in.

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

    Indicates whether cross-zone load balancing is enabled.

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

    Indicates whether deletion protection is enabled.

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

    Indicates whether the load balancer blocks traffic through the Internet Gateway (IGW).

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

    Whether the load balancer has an internet-routable address.

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

    Name of the load balancer.

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

    The minimum capacity (LCU) for a load balancer.

  • vpc_subnets (AWSCDK::EC2::SubnetSelection, nil) (defaults to: nil)

    Which subnets place the load balancer in.



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

def initialize(vpc:, cross_zone_enabled: nil, deletion_protection: nil, deny_all_igw_traffic: nil, internet_facing: nil, load_balancer_name: nil, minimum_capacity_unit: nil, vpc_subnets: nil)
  @vpc = vpc
  Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc")
  @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?
  @deletion_protection = deletion_protection
  Jsii::Type.check_type(@deletion_protection, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "deletionProtection") unless @deletion_protection.nil?
  @deny_all_igw_traffic = deny_all_igw_traffic
  Jsii::Type.check_type(@deny_all_igw_traffic, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "denyAllIgwTraffic") unless @deny_all_igw_traffic.nil?
  @internet_facing = internet_facing
  Jsii::Type.check_type(@internet_facing, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "internetFacing") unless @internet_facing.nil?
  @load_balancer_name = load_balancer_name
  Jsii::Type.check_type(@load_balancer_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "loadBalancerName") unless @load_balancer_name.nil?
  @minimum_capacity_unit = minimum_capacity_unit
  Jsii::Type.check_type(@minimum_capacity_unit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minimumCapacityUnit") unless @minimum_capacity_unit.nil?
  @vpc_subnets = vpc_subnets.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**vpc_subnets.transform_keys(&:to_sym)) : vpc_subnets
  Jsii::Type.check_type(@vpc_subnets, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "vpcSubnets") unless @vpc_subnets.nil?
end

Instance Attribute Details

#cross_zone_enabledBoolean? (readonly)

Note:

Default: - false for Network Load Balancers and true for Application Load Balancers. This can not be false for Application Load Balancers.

Indicates whether cross-zone load balancing is enabled.



43
44
45
# File 'elastic_load_balancingv2/base_load_balancer_props.rb', line 43

def cross_zone_enabled
  @cross_zone_enabled
end

#deletion_protectionBoolean? (readonly)

Note:

Default: false

Indicates whether deletion protection is enabled.

Returns:

  • (Boolean, nil)


48
49
50
# File 'elastic_load_balancingv2/base_load_balancer_props.rb', line 48

def deletion_protection
  @deletion_protection
end

#deny_all_igw_trafficBoolean? (readonly)

Note:

Default: - false for internet-facing load balancers and true for internal load balancers

Indicates whether the load balancer blocks traffic through the Internet Gateway (IGW).

Returns:

  • (Boolean, nil)


53
54
55
# File 'elastic_load_balancingv2/base_load_balancer_props.rb', line 53

def deny_all_igw_traffic
  @deny_all_igw_traffic
end

#internet_facingBoolean? (readonly)

Note:

Default: false

Whether the load balancer has an internet-routable address.

Returns:

  • (Boolean, nil)


58
59
60
# File 'elastic_load_balancingv2/base_load_balancer_props.rb', line 58

def internet_facing
  @internet_facing
end

#load_balancer_nameString? (readonly)

Note:

Default: - Automatically generated name.

Name of the load balancer.

Returns:

  • (String, nil)


63
64
65
# File 'elastic_load_balancingv2/base_load_balancer_props.rb', line 63

def load_balancer_name
  @load_balancer_name
end

#minimum_capacity_unitNumeric? (readonly)

Note:

Default: undefined - ELB default is 0 LCU

The minimum capacity (LCU) for a load balancer.



69
70
71
# File 'elastic_load_balancingv2/base_load_balancer_props.rb', line 69

def minimum_capacity_unit
  @minimum_capacity_unit
end

#vpcAWSCDK::EC2::IVPC (readonly)

The VPC network to place the load balancer in.

Returns:



37
38
39
# File 'elastic_load_balancingv2/base_load_balancer_props.rb', line 37

def vpc
  @vpc
end

#vpc_subnetsAWSCDK::EC2::SubnetSelection? (readonly)

Note:

Default: - the Vpc default strategy.

Which subnets place the load balancer in.



74
75
76
# File 'elastic_load_balancingv2/base_load_balancer_props.rb', line 74

def vpc_subnets
  @vpc_subnets
end

Class Method Details

.jsii_propertiesObject



76
77
78
79
80
81
82
83
84
85
86
87
# File 'elastic_load_balancingv2/base_load_balancer_props.rb', line 76

def self.jsii_properties
  {
    :vpc => "vpc",
    :cross_zone_enabled => "crossZoneEnabled",
    :deletion_protection => "deletionProtection",
    :deny_all_igw_traffic => "denyAllIgwTraffic",
    :internet_facing => "internetFacing",
    :load_balancer_name => "loadBalancerName",
    :minimum_capacity_unit => "minimumCapacityUnit",
    :vpc_subnets => "vpcSubnets",
  }
end

Instance Method Details

#to_jsiiObject



89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'elastic_load_balancingv2/base_load_balancer_props.rb', line 89

def to_jsii
  result = {}
  result.merge!({
    "vpc" => @vpc,
    "crossZoneEnabled" => @cross_zone_enabled,
    "deletionProtection" => @deletion_protection,
    "denyAllIgwTraffic" => @deny_all_igw_traffic,
    "internetFacing" => @internet_facing,
    "loadBalancerName" => @load_balancer_name,
    "minimumCapacityUnit" => @minimum_capacity_unit,
    "vpcSubnets" => @vpc_subnets,
  })
  result.compact
end