CfnSubnetPropsMixin

class aws_cdk.mixins_preview.aws_ec2.mixins.CfnSubnetPropsMixin(props, *, strategy=None)

Bases: Mixin

Specifies a subnet for the specified VPC.

For an IPv4 only subnet, specify an IPv4 CIDR block. If the VPC has an IPv6 CIDR block, you can create an IPv6 only subnet or a dual stack subnet instead. For an IPv6 only subnet, specify an IPv6 CIDR block. For a dual stack subnet, specify both an IPv4 CIDR block and an IPv6 CIDR block.

For more information, see Subnets for your VPC in the Amazon VPC User Guide .

See:

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

CloudformationResource:

AWS::EC2::Subnet

Mixin:

true

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.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_ec2 import mixins as ec2_mixins

# private_dns_name_options_on_launch: Any

cfn_subnet_props_mixin = ec2_mixins.CfnSubnetPropsMixin(ec2_mixins.CfnSubnetMixinProps(
    assign_ipv6_address_on_creation=False,
    availability_zone="availabilityZone",
    availability_zone_id="availabilityZoneId",
    cidr_block="cidrBlock",
    enable_dns64=False,
    enable_lni_at_device_index=123,
    ipv4_ipam_pool_id="ipv4IpamPoolId",
    ipv4_netmask_length=123,
    ipv6_cidr_block="ipv6CidrBlock",
    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"
    )],
    vpc_id="vpcId"
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::EC2::Subnet.

Parameters:
  • props (Union[CfnSubnetMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['assignIpv6AddressOnCreation', 'availabilityZone', 'availabilityZoneId', 'cidrBlock', 'enableDns64', 'enableLniAtDeviceIndex', 'ipv4IpamPoolId', 'ipv4NetmaskLength', 'ipv6CidrBlock', 'ipv6IpamPoolId', 'ipv6Native', 'ipv6NetmaskLength', 'mapPublicIpOnLaunch', 'outpostArn', 'privateDnsNameOptionsOnLaunch', 'tags', 'vpcId']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

BlockPublicAccessStatesProperty

class CfnSubnetPropsMixin.BlockPublicAccessStatesProperty(*, internet_gateway_block_mode=None)

Bases: object

Specifies the state of VPC Block Public Access (BPA).

Parameters:

internet_gateway_block_mode (Optional[str]) – The mode of VPC BPA. - off : VPC BPA is not enabled and traffic is allowed to and from internet gateways and egress-only internet gateways in this Region. - block-bidirectional : Block all traffic to and from internet gateways and egress-only internet gateways in this Region (except for excluded VPCs and subnets). - block-ingress : Block all internet traffic to the VPCs in this Region (except for VPCs or subnets which are excluded). Only traffic to and from NAT gateways and egress-only internet gateways is allowed because these gateways only allow outbound connections to be established.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-subnet-blockpublicaccessstates.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.mixins_preview.aws_ec2 import mixins as ec2_mixins

block_public_access_states_property = ec2_mixins.CfnSubnetPropsMixin.BlockPublicAccessStatesProperty(
    internet_gateway_block_mode="internetGatewayBlockMode"
)

Attributes

internet_gateway_block_mode

The mode of VPC BPA.

  • off : VPC BPA is not enabled and traffic is allowed to and from internet gateways and egress-only internet gateways in this Region.

  • block-bidirectional : Block all traffic to and from internet gateways and egress-only internet gateways in this Region (except for excluded VPCs and subnets).

  • block-ingress : Block all internet traffic to the VPCs in this Region (except for VPCs or subnets which are excluded). Only traffic to and from NAT gateways and egress-only internet gateways is allowed because these gateways only allow outbound connections to be established.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-subnet-blockpublicaccessstates.html#cfn-ec2-subnet-blockpublicaccessstates-internetgatewayblockmode

PrivateDnsNameOptionsOnLaunchProperty

class CfnSubnetPropsMixin.PrivateDnsNameOptionsOnLaunchProperty(*, enable_resource_name_dns_aaaa_record=None, enable_resource_name_dns_a_record=None, hostname_type=None)

Bases: object

Specifies the options for instance hostnames.

Parameters:
  • enable_resource_name_dns_aaaa_record (Union[bool, IResolvable, None]) – Indicates whether to respond to DNS queries for instance hostname with DNS AAAA records.

  • enable_resource_name_dns_a_record (Union[bool, IResolvable, None]) – Indicates whether to respond to DNS queries for instance hostnames with DNS A records.

  • hostname_type (Optional[str]) – The type of hostname for EC2 instances. For IPv4 only subnets, an instance DNS name must be based on the instance IPv4 address. For IPv6 only subnets, an instance DNS name must be based on the instance ID. For dual-stack subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-subnet-privatednsnameoptionsonlaunch.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.mixins_preview.aws_ec2 import mixins as ec2_mixins

private_dns_name_options_on_launch_property = ec2_mixins.CfnSubnetPropsMixin.PrivateDnsNameOptionsOnLaunchProperty(
    enable_resource_name_dns_aaaa_record=False,
    enable_resource_name_dns_aRecord=False,
    hostname_type="hostnameType"
)

Attributes

enable_resource_name_dns_a_record

Indicates whether to respond to DNS queries for instance hostnames with DNS A records.

See:

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

enable_resource_name_dns_aaaa_record

Indicates whether to respond to DNS queries for instance hostname with DNS AAAA records.

See:

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

hostname_type

The type of hostname for EC2 instances.

For IPv4 only subnets, an instance DNS name must be based on the instance IPv4 address. For IPv6 only subnets, an instance DNS name must be based on the instance ID. For dual-stack subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID.

See:

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