Class: AWSCDK::ElasticLoadBalancingv2::NetworkLoadBalancerProps
- Inherits:
-
BaseLoadBalancerProps
- Object
- BaseLoadBalancerProps
- AWSCDK::ElasticLoadBalancingv2::NetworkLoadBalancerProps
- Defined in:
- elastic_load_balancingv2/network_load_balancer_props.rb
Overview
Properties for a network load balancer.
Instance Attribute Summary collapse
-
#client_routing_policy ⇒ AWSCDK::ElasticLoadBalancingv2::ClientRoutingPolicy?
readonly
The AZ affinity routing policy.
-
#cross_zone_enabled ⇒ Boolean?
readonly
Indicates whether cross-zone load balancing is enabled.
-
#deletion_protection ⇒ Boolean?
readonly
Indicates whether deletion protection is enabled.
-
#deny_all_igw_traffic ⇒ Boolean?
readonly
Indicates whether the load balancer blocks traffic through the Internet Gateway (IGW).
-
#disable_security_groups ⇒ Boolean?
readonly
Create a Network Load Balancer without security groups.
-
#enable_prefix_for_ipv6_source_nat ⇒ Boolean?
readonly
Indicates whether to use an IPv6 prefix from each subnet for source NAT.
-
#enforce_security_group_inbound_rules_on_private_link_traffic ⇒ Boolean?
readonly
Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink.
-
#internet_facing ⇒ Boolean?
readonly
Whether the load balancer has an internet-routable address.
-
#ip_address_type ⇒ AWSCDK::ElasticLoadBalancingv2::IPAddressType?
readonly
The type of IP addresses to use.
-
#load_balancer_name ⇒ String?
readonly
Name of the load balancer.
-
#minimum_capacity_unit ⇒ Numeric?
readonly
The minimum capacity (LCU) for a load balancer.
-
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>?
readonly
Security groups to associate with this load balancer.
-
#subnet_mappings ⇒ Array<AWSCDK::ElasticLoadBalancingv2::SubnetMapping>?
readonly
Subnet information for the load balancer.
-
#vpc ⇒ AWSCDK::EC2::IVPC
readonly
The VPC network to place the load balancer in.
-
#vpc_subnets ⇒ AWSCDK::EC2::SubnetSelection?
readonly
Which subnets place the load balancer in.
-
#zonal_shift ⇒ Boolean?
readonly
Indicates whether zonal shift is enabled.
Class Method Summary collapse
Instance Method Summary collapse
-
#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, client_routing_policy: nil, disable_security_groups: nil, enable_prefix_for_ipv6_source_nat: nil, enforce_security_group_inbound_rules_on_private_link_traffic: nil, ip_address_type: nil, security_groups: nil, subnet_mappings: nil, zonal_shift: nil) ⇒ NetworkLoadBalancerProps
constructor
A new instance of NetworkLoadBalancerProps.
- #to_jsii ⇒ Object
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, client_routing_policy: nil, disable_security_groups: nil, enable_prefix_for_ipv6_source_nat: nil, enforce_security_group_inbound_rules_on_private_link_traffic: nil, ip_address_type: nil, security_groups: nil, subnet_mappings: nil, zonal_shift: nil) ⇒ NetworkLoadBalancerProps
Returns a new instance of NetworkLoadBalancerProps.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 23 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, client_routing_policy: nil, disable_security_groups: nil, enable_prefix_for_ipv6_source_nat: nil, enforce_security_group_inbound_rules_on_private_link_traffic: nil, ip_address_type: nil, security_groups: nil, subnet_mappings: nil, zonal_shift: 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? @client_routing_policy = client_routing_policy Jsii::Type.check_type(@client_routing_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5DbGllbnRSb3V0aW5nUG9saWN5In0=")), "clientRoutingPolicy") unless @client_routing_policy.nil? @disable_security_groups = disable_security_groups Jsii::Type.check_type(@disable_security_groups, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "disableSecurityGroups") unless @disable_security_groups.nil? @enable_prefix_for_ipv6_source_nat = enable_prefix_for_ipv6_source_nat Jsii::Type.check_type(@enable_prefix_for_ipv6_source_nat, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enablePrefixForIpv6SourceNat") unless @enable_prefix_for_ipv6_source_nat.nil? @enforce_security_group_inbound_rules_on_private_link_traffic = enforce_security_group_inbound_rules_on_private_link_traffic Jsii::Type.check_type(@enforce_security_group_inbound_rules_on_private_link_traffic, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enforceSecurityGroupInboundRulesOnPrivateLinkTraffic") unless @enforce_security_group_inbound_rules_on_private_link_traffic.nil? @ip_address_type = ip_address_type Jsii::Type.check_type(@ip_address_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5JcEFkZHJlc3NUeXBlIn0=")), "ipAddressType") unless @ip_address_type.nil? @security_groups = security_groups Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVNlY3VyaXR5R3JvdXAifSwia2luZCI6ImFycmF5In19")), "securityGroups") unless @security_groups.nil? @subnet_mappings = subnet_mappings.is_a?(Array) ? subnet_mappings.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::SubnetMapping.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : subnet_mappings Jsii::Type.check_type(@subnet_mappings, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLlN1Ym5ldE1hcHBpbmcifSwia2luZCI6ImFycmF5In19")), "subnetMappings") unless @subnet_mappings.nil? @zonal_shift = zonal_shift Jsii::Type.check_type(@zonal_shift, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "zonalShift") unless @zonal_shift.nil? end |
Instance Attribute Details
#client_routing_policy ⇒ AWSCDK::ElasticLoadBalancingv2::ClientRoutingPolicy? (readonly)
Default: - AZ affinity is disabled.
The AZ affinity routing policy.
104 105 106 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 104 def client_routing_policy @client_routing_policy end |
#cross_zone_enabled ⇒ Boolean? (readonly)
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.
67 68 69 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 67 def cross_zone_enabled @cross_zone_enabled end |
#deletion_protection ⇒ Boolean? (readonly)
Default: false
Indicates whether deletion protection is enabled.
72 73 74 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 72 def deletion_protection @deletion_protection end |
#deny_all_igw_traffic ⇒ Boolean? (readonly)
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).
77 78 79 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 77 def deny_all_igw_traffic @deny_all_igw_traffic end |
#disable_security_groups ⇒ Boolean? (readonly)
Default: false
Create a Network Load Balancer without security groups.
When true, creates an NLB that cannot have security groups attached. This is useful when you need to create a traditional NLB without security group associations.
This property only takes effect when the feature flag
@aws-cdk/aws-elasticloadbalancingv2:networkLoadBalancerWithSecurityGroupByDefault is enabled.
115 116 117 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 115 def disable_security_groups @disable_security_groups end |
#enable_prefix_for_ipv6_source_nat ⇒ Boolean? (readonly)
Default: undefined - NLB default behavior is false
Indicates whether to use an IPv6 prefix from each subnet for source NAT.
The IP address type must be IpAddressType.DUALSTACK.
122 123 124 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 122 def enable_prefix_for_ipv6_source_nat @enable_prefix_for_ipv6_source_nat end |
#enforce_security_group_inbound_rules_on_private_link_traffic ⇒ Boolean? (readonly)
Default: true
Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink.
127 128 129 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 127 def enforce_security_group_inbound_rules_on_private_link_traffic @enforce_security_group_inbound_rules_on_private_link_traffic end |
#internet_facing ⇒ Boolean? (readonly)
Default: false
Whether the load balancer has an internet-routable address.
82 83 84 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 82 def internet_facing @internet_facing end |
#ip_address_type ⇒ AWSCDK::ElasticLoadBalancingv2::IPAddressType? (readonly)
Default: IpAddressType.IPV4
The type of IP addresses to use.
If you want to add a UDP or TCP_UDP listener to the load balancer, you must choose IPv4.
135 136 137 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 135 def ip_address_type @ip_address_type end |
#load_balancer_name ⇒ String? (readonly)
Default: - Automatically generated name.
Name of the load balancer.
87 88 89 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 87 def load_balancer_name @load_balancer_name end |
#minimum_capacity_unit ⇒ Numeric? (readonly)
Default: undefined - ELB default is 0 LCU
The minimum capacity (LCU) for a load balancer.
93 94 95 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 93 def minimum_capacity_unit @minimum_capacity_unit end |
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>? (readonly)
Default: - No security groups associated with the load balancer.
Security groups to associate with this load balancer.
140 141 142 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 140 def security_groups @security_groups end |
#subnet_mappings ⇒ Array<AWSCDK::ElasticLoadBalancingv2::SubnetMapping>? (readonly)
Default: undefined - The VPC default strategy for subnets is used
Subnet information for the load balancer.
145 146 147 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 145 def subnet_mappings @subnet_mappings end |
#vpc ⇒ AWSCDK::EC2::IVPC (readonly)
The VPC network to place the load balancer in.
61 62 63 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 61 def vpc @vpc end |
#vpc_subnets ⇒ AWSCDK::EC2::SubnetSelection? (readonly)
Default: - the Vpc default strategy.
Which subnets place the load balancer in.
98 99 100 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 98 def vpc_subnets @vpc_subnets end |
#zonal_shift ⇒ Boolean? (readonly)
Default: false
Indicates whether zonal shift is enabled.
151 152 153 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 151 def zonal_shift @zonal_shift end |
Class Method Details
.jsii_properties ⇒ Object
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 153 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", :client_routing_policy => "clientRoutingPolicy", :disable_security_groups => "disableSecurityGroups", :enable_prefix_for_ipv6_source_nat => "enablePrefixForIpv6SourceNat", :enforce_security_group_inbound_rules_on_private_link_traffic => "enforceSecurityGroupInboundRulesOnPrivateLinkTraffic", :ip_address_type => "ipAddressType", :security_groups => "securityGroups", :subnet_mappings => "subnetMappings", :zonal_shift => "zonalShift", } end |
Instance Method Details
#to_jsii ⇒ Object
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'elastic_load_balancingv2/network_load_balancer_props.rb', line 174 def to_jsii result = {} result.merge!(super) 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, "clientRoutingPolicy" => @client_routing_policy, "disableSecurityGroups" => @disable_security_groups, "enablePrefixForIpv6SourceNat" => @enable_prefix_for_ipv6_source_nat, "enforceSecurityGroupInboundRulesOnPrivateLinkTraffic" => @enforce_security_group_inbound_rules_on_private_link_traffic, "ipAddressType" => @ip_address_type, "securityGroups" => @security_groups, "subnetMappings" => @subnet_mappings, "zonalShift" => @zonal_shift, }) result.compact end |