CfnSubnetProps

class aws_cdk.aws_ec2.CfnSubnetProps(*, vpc_id, assign_ipv6_address_on_creation=None, availability_zone=None, availability_zone_id=None, cidr_block=None, enable_dns64=None, ipv4_ipam_pool_id=None, ipv4_netmask_length=None, ipv6_cidr_block=None, ipv6_cidr_blocks=None, ipv6_ipam_pool_id=None, ipv6_native=None, ipv6_netmask_length=None, map_public_ip_on_launch=None, outpost_arn=None, private_dns_name_options_on_launch=None, tags=None)

Bases: object

Properties for defining a CfnSubnet.

Parameters:
  • vpc_id (str) – The ID of the VPC the subnet is in. If you update this property, you must also update the CidrBlock property.

  • assign_ipv6_address_on_creation (Union[bool, IResolvable, None]) – 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 an IPv6 CIDR block.

  • availability_zone (Optional[str]) – The Availability Zone of the subnet. If you update this property, you must also update the CidrBlock property.

  • availability_zone_id (Optional[str]) – The AZ ID of the subnet.

  • cidr_block (Optional[str]) – The IPv4 CIDR block assigned to the subnet. If you update this property, we create a new subnet, and then delete the existing one.

  • enable_dns64 (Union[bool, IResolvable, None]) – 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 .

  • ipv4_ipam_pool_id (Optional[str]) – An IPv4 IPAM pool ID for the subnet.

  • ipv4_netmask_length (Union[int, float, None]) – An IPv4 netmask length for the subnet.

  • ipv6_cidr_block (Optional[str]) – The IPv6 CIDR block. If you specify AssignIpv6AddressOnCreation , you must also specify an IPv6 CIDR block.

  • ipv6_cidr_blocks (Optional[Sequence[str]]) – The IPv6 network ranges for the subnet, in CIDR notation.

  • ipv6_ipam_pool_id (Optional[str]) – An IPv6 IPAM pool ID for the subnet.

  • ipv6_native (Union[bool, IResolvable, None]) – Indicates whether this is an IPv6 only subnet. For more information, see Subnet basics in the Amazon Virtual Private Cloud User Guide .

  • ipv6_netmask_length (Union[int, float, None]) – An IPv6 netmask length for the subnet.

  • map_public_ip_on_launch (Union[bool, IResolvable, None]) – Indicates whether instances launched in this subnet receive a public IPv4 address. The default value is false . 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 .

  • outpost_arn (Optional[str]) – The Amazon Resource Name (ARN) of the Outpost.

  • private_dns_name_options_on_launch (Optional[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. 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 (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – Any tags assigned to the subnet.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

# private_dns_name_options_on_launch: Any

cfn_subnet_props = ec2.CfnSubnetProps(
    vpc_id="vpcId",

    # the properties below are optional
    assign_ipv6_address_on_creation=False,
    availability_zone="availabilityZone",
    availability_zone_id="availabilityZoneId",
    cidr_block="cidrBlock",
    enable_dns64=False,
    ipv4_ipam_pool_id="ipv4IpamPoolId",
    ipv4_netmask_length=123,
    ipv6_cidr_block="ipv6CidrBlock",
    ipv6_cidr_blocks=["ipv6CidrBlocks"],
    ipv6_ipam_pool_id="ipv6IpamPoolId",
    ipv6_native=False,
    ipv6_netmask_length=123,
    map_public_ip_on_launch=False,
    outpost_arn="outpostArn",
    private_dns_name_options_on_launch=private_dns_name_options_on_launch,
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Attributes

assign_ipv6_address_on_creation

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 an IPv6 CIDR block.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-assignipv6addressoncreation

availability_zone

The Availability Zone of the subnet.

If you update this property, you must also update the CidrBlock property.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-availabilityzone

availability_zone_id

The AZ ID of the subnet.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-availabilityzoneid

cidr_block

The IPv4 CIDR block assigned to the subnet.

If you update this property, we create a new subnet, and then delete the existing one.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-cidrblock

enable_dns64

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-enabledns64

ipv4_ipam_pool_id

An IPv4 IPAM pool ID for the subnet.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-ipv4ipampoolid

ipv4_netmask_length

An IPv4 netmask length for the subnet.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-ipv4netmasklength

ipv6_cidr_block

The IPv6 CIDR block.

If you specify AssignIpv6AddressOnCreation , you must also specify an IPv6 CIDR block.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-ipv6cidrblock

ipv6_cidr_blocks

The IPv6 network ranges for the subnet, in CIDR notation.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-ipv6cidrblocks

ipv6_ipam_pool_id

An IPv6 IPAM pool ID for the subnet.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-ipv6ipampoolid

ipv6_native

Indicates whether this is an IPv6 only subnet.

For more information, see Subnet basics in the Amazon Virtual Private Cloud User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-ipv6native

ipv6_netmask_length

An IPv6 netmask length for the subnet.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-ipv6netmasklength

map_public_ip_on_launch

Indicates whether instances launched in this subnet receive a public IPv4 address. The default value is false .

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-mappubliciponlaunch

outpost_arn

The Amazon Resource Name (ARN) of the Outpost.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-outpostarn

private_dns_name_options_on_launch

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)

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-privatednsnameoptionsonlaunch

tags

Any tags assigned to the subnet.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-tags

vpc_id

The ID of the VPC the subnet is in.

If you update this property, you must also update the CidrBlock property.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#cfn-ec2-subnet-vpcid