CfnVPCProps

class aws_cdk.aws_ec2.CfnVPCProps(*, cidr_block, enable_dns_hostnames=None, enable_dns_support=None, instance_tenancy=None, tags=None)

Bases: object

Properties for defining a CfnVPC.

Parameters
  • cidr_block (str) – The primary IPv4 CIDR block for the VPC.

  • enable_dns_hostnames (Union[bool, IResolvable, None]) – Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see DNS attributes in your VPC . You can only enable DNS hostnames if you’ve enabled DNS support.

  • enable_dns_support (Union[bool, IResolvable, None]) –

    Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range “plus two” succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see DNS attributes in your VPC .

  • instance_tenancy (Optional[str]) – The allowed tenancy of instances launched into the VPC. - "default" : An instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different tenancy during instance launch. - "dedicated" : An instance launched into the VPC is a Dedicated Instance by default, unless you explicitly specify a tenancy of host during instance launch. You cannot specify a tenancy of default during instance launch. Updating InstanceTenancy requires no replacement only if you are updating its value from "dedicated" to "default" . Updating InstanceTenancy from "default" to "dedicated" requires replacement.

  • tags (Optional[Sequence[CfnTag]]) – The tags for the VPC.

Link

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

ExampleMetadata

fixture=_generated

Example:

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

cfn_vPCProps = ec2.CfnVPCProps(
    cidr_block="cidrBlock",

    # the properties below are optional
    enable_dns_hostnames=False,
    enable_dns_support=False,
    instance_tenancy="instanceTenancy",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Attributes

cidr_block

The primary IPv4 CIDR block for the VPC.

Link

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

Return type

str

enable_dns_hostnames

Indicates whether the instances launched in the VPC get DNS hostnames.

If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see DNS attributes in your VPC .

You can only enable DNS hostnames if you’ve enabled DNS support.

Link

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

Return type

Union[bool, IResolvable, None]

enable_dns_support

Indicates whether the DNS resolution is supported for the VPC.

If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range “plus two” succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see DNS attributes in your VPC .

Link

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

Return type

Union[bool, IResolvable, None]

instance_tenancy

The allowed tenancy of instances launched into the VPC.

  • "default" : An instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different tenancy during instance launch.

  • "dedicated" : An instance launched into the VPC is a Dedicated Instance by default, unless you explicitly specify a tenancy of host during instance launch. You cannot specify a tenancy of default during instance launch.

Updating InstanceTenancy requires no replacement only if you are updating its value from "dedicated" to "default" . Updating InstanceTenancy from "default" to "dedicated" requires replacement.

Link

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

Return type

Optional[str]

tags

The tags for the VPC.

Link

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

Return type

Optional[List[CfnTag]]