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, ipv6_cidr_block=None, ipv6_native=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 Ipv6CidrBlock .

  • 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 .

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

  • 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 .

  • 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 .

  • 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 .

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – Any tags assigned to the subnet.

Link

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,
    ipv6_cidr_block="ipv6CidrBlock",
    ipv6_native=False,
    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 Ipv6CidrBlock .

Link

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

Return type

Union[bool, IResolvable, None]

availability_zone

The Availability Zone of the subnet.

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

Link

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

Return type

Optional[str]

availability_zone_id

The AZ ID of the subnet.

Link

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

Return type

Optional[str]

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.

Link

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

Return type

Optional[str]

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 .

Link

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

Return type

Union[bool, IResolvable, None]

ipv6_cidr_block

The IPv6 CIDR block.

If you specify AssignIpv6AddressOnCreation , you must also specify Ipv6CidrBlock .

Link

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

Return type

Optional[str]

ipv6_native

Indicates whether this is an IPv6 only subnet.

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

Link

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

Return type

Union[bool, IResolvable, None]

map_public_ip_on_launch

Indicates whether instances launched in this subnet receive a public IPv4 address.

The default value is false .

Link

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

Return type

Union[bool, IResolvable, None]

outpost_arn

The Amazon Resource Name (ARN) of the Outpost.

Link

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

Return type

Optional[str]

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 .

Link

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

Return type

Any

tags

Any tags assigned to the subnet.

Link

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

Return type

Optional[List[CfnTag]]

vpc_id

The ID of the VPC the subnet is in.

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

Link

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

Return type

str