EC2.Client.
create_default_vpc
(**kwargs)¶Creates a default VPC with a size /16
IPv4 CIDR block and a default subnet in each Availability Zone. For more information about the components of a default VPC, see Default VPC and default subnets in the Amazon Virtual Private Cloud User Guide . You cannot specify the components of the default VPC yourself.
If you deleted your previous default VPC, you can create a default VPC. You cannot have more than one default VPC per Region.
If your account supports EC2-Classic, you cannot use this action to create a default VPC in a Region that supports EC2-Classic. If you want a default VPC in a Region that supports EC2-Classic, see "I really want a default VPC for my existing EC2 account. Is that possible?" in the Default VPCs FAQ.
Note
We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_default_vpc(
DryRun=True|False
)
DryRunOperation
. Otherwise, it is UnauthorizedOperation
.{
'Vpc': {
'CidrBlock': 'string',
'DhcpOptionsId': 'string',
'State': 'pending'|'available',
'VpcId': 'string',
'OwnerId': 'string',
'InstanceTenancy': 'default'|'dedicated'|'host',
'Ipv6CidrBlockAssociationSet': [
{
'AssociationId': 'string',
'Ipv6CidrBlock': 'string',
'Ipv6CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
},
'NetworkBorderGroup': 'string',
'Ipv6Pool': 'string'
},
],
'CidrBlockAssociationSet': [
{
'AssociationId': 'string',
'CidrBlock': 'string',
'CidrBlockState': {
'State': 'associating'|'associated'|'disassociating'|'disassociated'|'failing'|'failed',
'StatusMessage': 'string'
}
},
],
'IsDefault': True|False,
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
}
Response Structure
Information about the VPC.
The primary IPv4 CIDR block for the VPC.
The ID of the set of DHCP options you've associated with the VPC.
The current state of the VPC.
The ID of the VPC.
The ID of the Amazon Web Services account that owns the VPC.
The allowed tenancy of instances launched into the VPC.
Information about the IPv6 CIDR blocks associated with the VPC.
Describes an IPv6 CIDR block associated with a VPC.
The association ID for the IPv6 CIDR block.
The IPv6 CIDR block.
Information about the state of the CIDR block.
The state of the CIDR block.
A message about the status of the CIDR block, if applicable.
The name of the unique set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses, for example, us-east-1-wl1-bos-wlz-1
.
The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated.
Information about the IPv4 CIDR blocks associated with the VPC.
Describes an IPv4 CIDR block associated with a VPC.
The association ID for the IPv4 CIDR block.
The IPv4 CIDR block.
Information about the state of the CIDR block.
The state of the CIDR block.
A message about the status of the CIDR block, if applicable.
Indicates whether the VPC is the default VPC.
Any tags assigned to the VPC.
Describes a tag.
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:
.
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.