interface CfnSubnetProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.CfnSubnetProps |
Java | software.amazon.awscdk.services.ec2.CfnSubnetProps |
Python | aws_cdk.aws_ec2.CfnSubnetProps |
TypeScript | @aws-cdk/aws-ec2 » CfnSubnetProps |
Properties for defining a CfnSubnet
.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as ec2 from '@aws-cdk/aws-ec2';
declare const privateDnsNameOptionsOnLaunch: any;
const cfnSubnetProps: ec2.CfnSubnetProps = {
vpcId: 'vpcId',
// the properties below are optional
assignIpv6AddressOnCreation: false,
availabilityZone: 'availabilityZone',
availabilityZoneId: 'availabilityZoneId',
cidrBlock: 'cidrBlock',
enableDns64: false,
ipv6CidrBlock: 'ipv6CidrBlock',
ipv6Native: false,
mapPublicIpOnLaunch: false,
outpostArn: 'outpostArn',
privateDnsNameOptionsOnLaunch: privateDnsNameOptionsOnLaunch,
tags: [{
key: 'key',
value: 'value',
}],
};
Properties
Name | Type | Description |
---|---|---|
vpc | string | The ID of the VPC the subnet is in. |
assign | boolean | IResolvable | Indicates whether a network interface created in this subnet receives an IPv6 address. The default value is false . |
availability | string | The Availability Zone of the subnet. |
availability | string | The AZ ID of the subnet. |
cidr | string | The IPv4 CIDR block assigned to the subnet. |
enable | boolean | IResolvable | Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations. |
ipv6 | string | The IPv6 CIDR block. |
ipv6 | boolean | IResolvable | Indicates whether this is an IPv6 only subnet. |
map | boolean | IResolvable | Indicates whether instances launched in this subnet receive a public IPv4 address. |
outpost | string | The Amazon Resource Name (ARN) of the Outpost. |
private | any | 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? | Cfn [] | Any tags assigned to the subnet. |
vpcId
Type:
string
The ID of the VPC the subnet is in.
If you update this property, you must also update the CidrBlock
property.
assignIpv6AddressOnCreation?
Type:
boolean |
IResolvable
(optional)
Indicates whether a network interface created in this subnet receives an IPv6 address. The default value is false
.
If you specify AssignIpv6AddressOnCreation
, you must also specify Ipv6CidrBlock
.
availabilityZone?
Type:
string
(optional)
The Availability Zone of the subnet.
If you update this property, you must also update the CidrBlock
property.
availabilityZoneId?
Type:
string
(optional)
The AZ ID of the subnet.
cidrBlock?
Type:
string
(optional)
The IPv4 CIDR block assigned to the subnet.
If you update this property, we create a new subnet, and then delete the existing one.
enableDns64?
Type:
boolean |
IResolvable
(optional)
Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.
For more information, see DNS64 and NAT64 in the Amazon Virtual Private Cloud User Guide .
ipv6CidrBlock?
Type:
string
(optional)
The IPv6 CIDR block.
If you specify AssignIpv6AddressOnCreation
, you must also specify Ipv6CidrBlock
.
ipv6Native?
Type:
boolean |
IResolvable
(optional)
Indicates whether this is an IPv6 only subnet.
For more information, see Subnet basics in the Amazon Virtual Private Cloud User Guide .
mapPublicIpOnLaunch?
Type:
boolean |
IResolvable
(optional)
Indicates whether instances launched in this subnet receive a public IPv4 address.
The default value is false
.
outpostArn?
Type:
string
(optional)
The Amazon Resource Name (ARN) of the Outpost.
privateDnsNameOptionsOnLaunch?
Type:
any
(optional)
The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries to the instances should be handled.
For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide .
Available options:
- EnableResourceNameDnsAAAARecord (true | false)
- EnableResourceNameDnsARecord (true | false)
- HostnameType (ip-name | resource-name)
tags?
Type:
Cfn
[]
(optional)
Any tags assigned to the subnet.