Amazon Elastic Compute Cloud
API Reference (API Version 2014-10-01)
Did this page help you?  Yes | No |  Tell us about it...
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.

CreateVpc

Creates a VPC with the specified CIDR block.

The smallest VPC you can create uses a /28 netmask (16 IP addresses), and the largest uses a /16 netmask (65,536 IP addresses). To help you decide how big to make your VPC, see Your VPC and Subnets in the Amazon Virtual Private Cloud User Guide.

By default, each instance you launch in the VPC has the default DHCP options, which includes only a default DNS server that we provide (AmazonProvidedDNS). For more information about DHCP options, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide.

Request Parameters

For information about the common parameters that all actions use, see Common Query Parameters.

CidrBlock

The network range for the VPC, in CIDR notation. For example, 10.0.0.0/16.

Type: String

Required: Yes

DryRun

Type: Boolean

Required: No

InstanceTenancy

The supported tenancy options for instances launched into the VPC. A value of default means that instances can be launched with any tenancy; a value of dedicated means all instances launched into the VPC are launched as dedicated tenancy instances regardless of the tenancy assigned to the instance at launch. Dedicated tenancy instances run on single-tenant hardware.

Default: default

Type: String

Valid Values: default | dedicated

Required: No

Response Elements

The following elements are returned.

requestId

The ID of the request.

Type: String

vpc

Information about the VPC.

Type: Vpc

Errors

For information about the errors that are common to all actions, see Common Client Errors.

Examples

Example 1

This example creates a VPC with the CIDR block 10.0.0.0/16.

Sample Request

https://ec2.amazonaws.com/?Action=CreateVpc
&CidrBlock=10.0.0.0/16
&AUTHPARAMS

Sample Response

<CreateVpcResponse xmlns="http://ec2.amazonaws.com/doc/2014-10-01/">					
   <requestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</requestId>
   <vpc>
      <vpcId>vpc-1a2b3c4d</vpcId>
      <state>pending</state>
      <cidrBlock>10.0.0.0/16</cidrBlock>   
      <dhcpOptionsId>dopt-1a2b3c4d2</dhcpOptionsId>
      <instanceTenancy>default</instanceTenancy>
      <tagSet/>
   </vpc>
</CreateVpcResponse>

Example 2

This example creates a VPC with the dedicated tenancy option.

Sample Request

https://ec2.amazonaws.com/?Action=CreateVpc
&CidrBlock=10.32.0.0/16
&InstanceTenancy=dedicated
&AUTHPARAMS

Sample Response

<CreateVpcResponse xmlns="http://ec2.amazonaws.com/doc/2014-10-01/">
    <requestId>a9e49797-a74f-4f68-b302-a134a51fd054</requestId>
    <vpc>
        <vpcId>vpc-11a63c78</vpcId>
        <state>pending</state>
        <cidrBlock>10.32.0.0/16</cidrBlock>
        <dhcpOptionsId>dopt-1a2b3c4d2</dhcpOptionsId>
        <instanceTenancy>dedicated</instanceTenancy>
    </vpc>
</CreateVpcResponse>