Class SubnetConfiguration
Specify configuration parameters for a single subnet group in a VPC.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class SubnetConfiguration : Object, ISubnetConfiguration
Syntax (vb)
Public Class SubnetConfiguration
Inherits Object
Implements ISubnetConfiguration
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var subnetConfiguration = new SubnetConfiguration {
Name = "name",
SubnetType = SubnetType.PRIVATE_ISOLATED,
// the properties below are optional
CidrMask = 123,
Ipv6AssignAddressOnCreation = false,
MapPublicIpOnLaunch = false,
Reserved = false
};
Synopsis
Constructors
SubnetConfiguration() |
Properties
CidrMask | The number of leading 1 bits in the routing mask. |
Ipv6AssignAddressOnCreation | This property is specific to dual stack VPCs. |
MapPublicIpOnLaunch | Controls if a public IPv4 address is associated to an instance at launch. |
Name | Logical name for the subnet group. |
Reserved | Controls if subnet IP space needs to be reserved. |
SubnetType | The type of Subnet to configure. |
Constructors
SubnetConfiguration()
public SubnetConfiguration()
Properties
CidrMask
The number of leading 1 bits in the routing mask.
public Nullable<double> CidrMask { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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.
Default: - Available IP space is evenly divided across subnets.
Ipv6AssignAddressOnCreation
This property is specific to dual stack VPCs.
public Nullable<bool> Ipv6AssignAddressOnCreation { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
If set to false, then an IPv6 address will not be automatically assigned.
Note this is specific to IPv6 addresses.
Default: true
MapPublicIpOnLaunch
Controls if a public IPv4 address is associated to an instance at launch.
public Nullable<bool> MapPublicIpOnLaunch { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Note this is specific to IPv4 addresses.
Default: true in Subnet.Public of IPV4_ONLY VPCs, false otherwise
Name
Logical name for the subnet group.
public string Name { get; set; }
Property Value
System.String
Remarks
This name can be used when selecting VPC subnets to distinguish between different subnet groups of the same type.
Reserved
Controls if subnet IP space needs to be reserved.
public Nullable<bool> Reserved { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
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 cidrMask
- all other subnet
properties are ignored.
Default: false
SubnetType
The type of Subnet to configure.
public SubnetType SubnetType { get; set; }
Property Value
Remarks
The Subnet type will control the ability to route and connect to the Internet.