Class: AWSCDK::EC2::SubnetConfiguration
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EC2::SubnetConfiguration
- Defined in:
- ec2/subnet_configuration.rb
Overview
Specify configuration parameters for a single subnet group in a VPC.
Instance Attribute Summary collapse
-
#cidr_mask ⇒ Numeric?
readonly
The number of leading 1 bits in the routing mask.
-
#ipv6_assign_address_on_creation ⇒ Boolean?
readonly
This property is specific to dual stack VPCs.
-
#map_public_ip_on_launch ⇒ Boolean?
readonly
Controls if a public IPv4 address is associated to an instance at launch.
-
#name ⇒ String
readonly
Logical name for the subnet group.
-
#reserved ⇒ Boolean?
readonly
Controls if subnet IP space needs to be reserved.
-
#subnet_type ⇒ AWSCDK::EC2::SubnetType
readonly
The type of Subnet to configure.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:, subnet_type:, cidr_mask: nil, ipv6_assign_address_on_creation: nil, map_public_ip_on_launch: nil, reserved: nil) ⇒ SubnetConfiguration
constructor
A new instance of SubnetConfiguration.
- #to_jsii ⇒ Object
Constructor Details
#initialize(name:, subnet_type:, cidr_mask: nil, ipv6_assign_address_on_creation: nil, map_public_ip_on_launch: nil, reserved: nil) ⇒ SubnetConfiguration
Returns a new instance of SubnetConfiguration.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'ec2/subnet_configuration.rb', line 13 def initialize(name:, subnet_type:, cidr_mask: nil, ipv6_assign_address_on_creation: nil, map_public_ip_on_launch: nil, reserved: nil) @name = name Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") @subnet_type = subnet_type Jsii::Type.check_type(@subnet_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFR5cGUifQ==")), "subnetType") @cidr_mask = cidr_mask Jsii::Type.check_type(@cidr_mask, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "cidrMask") unless @cidr_mask.nil? @ipv6_assign_address_on_creation = ipv6_assign_address_on_creation Jsii::Type.check_type(@ipv6_assign_address_on_creation, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "ipv6AssignAddressOnCreation") unless @ipv6_assign_address_on_creation.nil? @map_public_ip_on_launch = map_public_ip_on_launch Jsii::Type.check_type(@map_public_ip_on_launch, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "mapPublicIpOnLaunch") unless @map_public_ip_on_launch.nil? @reserved = reserved Jsii::Type.check_type(@reserved, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "reserved") unless @reserved.nil? end |
Instance Attribute Details
#cidr_mask ⇒ Numeric? (readonly)
Default: - Available IP space is evenly divided across subnets.
The number of leading 1 bits in the routing mask.
The number of available IP addresses in each subnet of this group
will be equal to 2^(32 - cidrMask) - 2.
Valid values are 16--28.
Note this is specific to IPv4 addresses.
53 54 55 |
# File 'ec2/subnet_configuration.rb', line 53 def cidr_mask @cidr_mask end |
#ipv6_assign_address_on_creation ⇒ Boolean? (readonly)
Default: true
This property is specific to dual stack VPCs.
If set to false, then an IPv6 address will not be automatically assigned.
Note this is specific to IPv6 addresses.
62 63 64 |
# File 'ec2/subnet_configuration.rb', line 62 def ipv6_assign_address_on_creation @ipv6_assign_address_on_creation end |
#map_public_ip_on_launch ⇒ Boolean? (readonly)
Default: true in Subnet.Public of IPV4_ONLY VPCs, false otherwise
Controls if a public IPv4 address is associated to an instance at launch.
Note this is specific to IPv4 addresses.
69 70 71 |
# File 'ec2/subnet_configuration.rb', line 69 def map_public_ip_on_launch @map_public_ip_on_launch end |
#name ⇒ String (readonly)
Logical name for the subnet group.
This name can be used when selecting VPC subnets to distinguish between different subnet groups of the same type.
34 35 36 |
# File 'ec2/subnet_configuration.rb', line 34 def name @name end |
#reserved ⇒ Boolean? (readonly)
Default: false
Controls if subnet IP space needs to be reserved.
When true, the IP space for the subnet is reserved but no actual
resources are provisioned. This space is only dependent on the
number of availability zones and on cidr_mask - all other subnet
properties are ignored.
79 80 81 |
# File 'ec2/subnet_configuration.rb', line 79 def reserved @reserved end |
#subnet_type ⇒ AWSCDK::EC2::SubnetType (readonly)
The type of Subnet to configure.
The Subnet type will control the ability to route and connect to the Internet.
41 42 43 |
# File 'ec2/subnet_configuration.rb', line 41 def subnet_type @subnet_type end |
Class Method Details
.jsii_properties ⇒ Object
81 82 83 84 85 86 87 88 89 90 |
# File 'ec2/subnet_configuration.rb', line 81 def self.jsii_properties { :name => "name", :subnet_type => "subnetType", :cidr_mask => "cidrMask", :ipv6_assign_address_on_creation => "ipv6AssignAddressOnCreation", :map_public_ip_on_launch => "mapPublicIpOnLaunch", :reserved => "reserved", } end |
Instance Method Details
#to_jsii ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'ec2/subnet_configuration.rb', line 92 def to_jsii result = {} result.merge!({ "name" => @name, "subnetType" => @subnet_type, "cidrMask" => @cidr_mask, "ipv6AssignAddressOnCreation" => @ipv6_assign_address_on_creation, "mapPublicIpOnLaunch" => @map_public_ip_on_launch, "reserved" => @reserved, }) result.compact end |