Class: AWSCDK::ElasticLoadBalancingv2::SubnetMapping

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

Overview

Specifies a subnet for a load balancer.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subnet:, allocation_id: nil, ipv6_address: nil, private_ipv4_address: nil, source_nat_ipv6_prefix: nil) ⇒ SubnetMapping

Returns a new instance of SubnetMapping.

Parameters:

  • subnet (AWSCDK::EC2::ISubnet)

    The subnet.

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

    The allocation ID of the Elastic IP address for an internet-facing load balancer.

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

    The IPv6 address.

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

    The private IPv4 address for an internal load balancer.

  • source_nat_ipv6_prefix (AWSCDK::ElasticLoadBalancingv2::SourceNatIpv6Prefix, nil) (defaults to: nil)

    The IPv6 prefix to use for source NAT for a dual-stack network load balancer with UDP listeners.



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

def initialize(subnet:, allocation_id: nil, ipv6_address: nil, private_ipv4_address: nil, source_nat_ipv6_prefix: nil)
  @subnet = subnet
  Jsii::Type.check_type(@subnet, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklTdWJuZXQifQ==")), "subnet")
  @allocation_id = allocation_id
  Jsii::Type.check_type(@allocation_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "allocationId") unless @allocation_id.nil?
  @ipv6_address = ipv6_address
  Jsii::Type.check_type(@ipv6_address, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ipv6Address") unless @ipv6_address.nil?
  @private_ipv4_address = private_ipv4_address
  Jsii::Type.check_type(@private_ipv4_address, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "privateIpv4Address") unless @private_ipv4_address.nil?
  @source_nat_ipv6_prefix = source_nat_ipv6_prefix
  Jsii::Type.check_type(@source_nat_ipv6_prefix, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5Tb3VyY2VOYXRJcHY2UHJlZml4In0=")), "sourceNatIpv6Prefix") unless @source_nat_ipv6_prefix.nil?
end

Instance Attribute Details

#allocation_idString? (readonly)

Note:

Default: undefined - AWS default is to allocate a new IP address for internet-facing load balancers

The allocation ID of the Elastic IP address for an internet-facing load balancer.

Returns:

  • (String, nil)


33
34
35
# File 'elastic_load_balancingv2/subnet_mapping.rb', line 33

def allocation_id
  @allocation_id
end

#ipv6_addressString? (readonly)

Note:

Default: undefined - AWS default is to allocate an IPv6 address from the subnet's pool

The IPv6 address.

Returns:

  • (String, nil)


38
39
40
# File 'elastic_load_balancingv2/subnet_mapping.rb', line 38

def ipv6_address
  @ipv6_address
end

#private_ipv4_addressString? (readonly)

Note:

Default: undefined - AWS default is to allocate a private IPv4 address from the subnet's pool

The private IPv4 address for an internal load balancer.

Returns:

  • (String, nil)


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

def private_ipv4_address
  @private_ipv4_address
end

#source_nat_ipv6_prefixAWSCDK::ElasticLoadBalancingv2::SourceNatIpv6Prefix? (readonly)

Note:

Default: undefined - AWS default is SourceNatIpv6Prefix.autoAssigned() for IPv6 load balancers

The IPv6 prefix to use for source NAT for a dual-stack network load balancer with UDP listeners.

Specify an IPv6 prefix (/80 netmask) from the subnet CIDR block or SourceNatIpv6Prefix.autoAssigned() to use an IPv6 prefix selected at random from the subnet CIDR block.



51
52
53
# File 'elastic_load_balancingv2/subnet_mapping.rb', line 51

def source_nat_ipv6_prefix
  @source_nat_ipv6_prefix
end

#subnetAWSCDK::EC2::ISubnet (readonly)

The subnet.



28
29
30
# File 'elastic_load_balancingv2/subnet_mapping.rb', line 28

def subnet
  @subnet
end

Class Method Details

.jsii_propertiesObject



53
54
55
56
57
58
59
60
61
# File 'elastic_load_balancingv2/subnet_mapping.rb', line 53

def self.jsii_properties
  {
    :subnet => "subnet",
    :allocation_id => "allocationId",
    :ipv6_address => "ipv6Address",
    :private_ipv4_address => "privateIpv4Address",
    :source_nat_ipv6_prefix => "sourceNatIpv6Prefix",
  }
end

Instance Method Details

#to_jsiiObject



63
64
65
66
67
68
69
70
71
72
73
# File 'elastic_load_balancingv2/subnet_mapping.rb', line 63

def to_jsii
  result = {}
  result.merge!({
    "subnet" => @subnet,
    "allocationId" => @allocation_id,
    "ipv6Address" => @ipv6_address,
    "privateIpv4Address" => @private_ipv4_address,
    "sourceNatIpv6Prefix" => @source_nat_ipv6_prefix,
  })
  result.compact
end