Interface ICfnSubnetProps
Properties for defining a CfnSubnet.
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ICfnSubnetProps
Syntax (vb)
Public Interface ICfnSubnetProps
Remarks
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html
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 privateDnsNameOptionsOnLaunch;
var cfnSubnetProps = new CfnSubnetProps {
VpcId = "vpcId",
// the properties below are optional
AssignIpv6AddressOnCreation = false,
AvailabilityZone = "availabilityZone",
AvailabilityZoneId = "availabilityZoneId",
CidrBlock = "cidrBlock",
EnableDns64 = false,
EnableLniAtDeviceIndex = 123,
Ipv4IpamPoolId = "ipv4IpamPoolId",
Ipv4NetmaskLength = 123,
Ipv6CidrBlock = "ipv6CidrBlock",
Ipv6IpamPoolId = "ipv6IpamPoolId",
Ipv6Native = false,
Ipv6NetmaskLength = 123,
MapPublicIpOnLaunch = false,
OutpostArn = "outpostArn",
PrivateDnsNameOptionsOnLaunch = privateDnsNameOptionsOnLaunch,
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
};
Synopsis
Properties
| AssignIpv6AddressOnCreation | Indicates whether a network interface created in this subnet receives an IPv6 address. The default value is |
| AvailabilityZone | The Availability Zone of the subnet. |
| AvailabilityZoneId | The AZ ID of the subnet. |
| CidrBlock | The IPv4 CIDR block assigned to the subnet. |
| EnableDns64 | Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. |
| EnableLniAtDeviceIndex | Indicates the device position for local network interfaces in this subnet. |
| Ipv4IpamPoolId | An IPv4 IPAM pool ID for the subnet. |
| Ipv4NetmaskLength | An IPv4 netmask length for the subnet. |
| Ipv6CidrBlock | The IPv6 CIDR block. |
| Ipv6IpamPoolId | An IPv6 IPAM pool ID for the subnet. |
| Ipv6Native | Indicates whether this is an IPv6 only subnet. |
| Ipv6NetmaskLength | An IPv6 netmask length for the subnet. |
| MapPublicIpOnLaunch | Indicates whether instances launched in this subnet receive a public IPv4 address. The default value is |
| OutpostArn | The Amazon Resource Name (ARN) of the Outpost. |
| PrivateDnsNameOptionsOnLaunch | The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries to the instances should be handled. |
| Tags | Any tags assigned to the subnet. |
| VpcId | The ID of the VPC the subnet is in. |
Properties
AssignIpv6AddressOnCreation
Indicates whether a network interface created in this subnet receives an IPv6 address. The default value is false .
object? AssignIpv6AddressOnCreation { get; }
Property Value
Remarks
If you specify AssignIpv6AddressOnCreation , you must also specify an IPv6 CIDR block.
Type union: either bool or IResolvable
AvailabilityZone
The Availability Zone of the subnet.
string? AvailabilityZone { get; }
Property Value
Remarks
If you update this property, you must also update the CidrBlock property.
AvailabilityZoneId
The AZ ID of the subnet.
string? AvailabilityZoneId { get; }
Property Value
Remarks
CidrBlock
The IPv4 CIDR block assigned to the subnet.
string? CidrBlock { get; }
Property Value
Remarks
If you update this property, we create a new subnet, and then delete the existing one.
EnableDns64
Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.
object? EnableDns64 { get; }
Property Value
Remarks
You must first configure a NAT gateway in a public subnet (separate from the subnet containing the IPv6-only workloads). For example, the subnet containing the NAT gateway should have a <code>0.0.0.0/0</code> route pointing to the internet gateway. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/nat-gateway-nat64-dns64.html#nat-gateway-nat64-dns64-walkthrough">Configure DNS64 and NAT64</a> in the <em>Amazon Virtual Private Cloud User Guide</em> .
Type union: either bool or IResolvable
EnableLniAtDeviceIndex
Indicates the device position for local network interfaces in this subnet.
double? EnableLniAtDeviceIndex { get; }
Property Value
Remarks
For example, 1 indicates local network interfaces in this subnet are the secondary network interface (eth1).
Ipv4IpamPoolId
An IPv4 IPAM pool ID for the subnet.
string? Ipv4IpamPoolId { get; }
Property Value
Remarks
Ipv4NetmaskLength
An IPv4 netmask length for the subnet.
double? Ipv4NetmaskLength { get; }
Property Value
Remarks
Ipv6CidrBlock
The IPv6 CIDR block.
string? Ipv6CidrBlock { get; }
Property Value
Remarks
If you specify AssignIpv6AddressOnCreation , you must also specify an IPv6 CIDR block.
Ipv6IpamPoolId
An IPv6 IPAM pool ID for the subnet.
string? Ipv6IpamPoolId { get; }
Property Value
Remarks
Ipv6Native
Indicates whether this is an IPv6 only subnet.
object? Ipv6Native { get; }
Property Value
Remarks
For more information, see Subnet basics in the Amazon Virtual Private Cloud User Guide .
Type union: either bool or IResolvable
Ipv6NetmaskLength
An IPv6 netmask length for the subnet.
double? Ipv6NetmaskLength { get; }
Property Value
Remarks
MapPublicIpOnLaunch
Indicates whether instances launched in this subnet receive a public IPv4 address. The default value is false .
object? MapPublicIpOnLaunch { get; }
Property Value
Remarks
AWS charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the VPC pricing page .
Type union: either bool or IResolvable
OutpostArn
The Amazon Resource Name (ARN) of the Outpost.
string? OutpostArn { get; }
Property Value
Remarks
PrivateDnsNameOptionsOnLaunch
The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries to the instances should be handled.
object? PrivateDnsNameOptionsOnLaunch { get; }
Property Value
Remarks
For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide .
Available options:
Tags
VpcId
The ID of the VPC the subnet is in.
object VpcId { get; }
Property Value
Remarks
If you update this property, you must also update the CidrBlock property.
Type union: either string or IVPCRef