Class SubnetConfiguration
Specify configuration parameters for a single subnet group in a VPC.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.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.ISOLATED,
// the properties below are optional
CidrMask = 123,
MapPublicIpOnLaunch = false,
Reserved = false
};
Synopsis
Constructors
SubnetConfiguration() |
Properties
CidrMask | The number of leading 1 bits in the routing mask. |
MapPublicIpOnLaunch | Controls if a public IP 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
.
Default: - Available IP space is evenly divided across subnets.
MapPublicIpOnLaunch
Controls if a public IP is associated to an instance at launch.
public Nullable<bool> MapPublicIpOnLaunch { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true in Subnet.Public, false in Subnet.Private or Subnet.Isolated.
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.