Create VPC operation for the Amazon EC2 REST adapter


The Create VPC operation enables you to create a Virtual Private Cloud (VPC) with the Classless Inter-Domain Routing (CIDR) block that you specify. CIDR is a method for allocating IP addresses and routing packets.

The smallest VPC that you can create uses a /28 netmask (16 IP addresses) and the largest uses a /16 netmask (65,536 IP addresses).

The following figure shows a sample <items> XML element for the Create VPC operation. 

Sample <items> XML element for the Create VPC operation

<items>
 <item>
   <parameters>
     <cidr-block></cidr-block>
     <!--Optional:-->
     <instance-tenancy></instance-tenancy>
   </parameters>
 </item>
</items>

The following table describes the elements for this adapter request. 

Adapter request elements for the Create VPC operation

Element

Definition

Required

<wsdl-location>

Specifies the target Web Service Description Language (WSDL) URL for Amazon EC2

Examples:

Conditional:

  • Required if not specified in the configuration
  • If specified in the configuration and request, the value in the request overrides the value in the configuration
<endpoint-address>

Specifies the web service endpoint for the adapter to use while performing operations on Amazon EC2 instances across different regions

Default value: US East region, http://us-east-1.ec2.amazonaws.com/

No

<signature-properties>

Specifies the mode for signing the adapter request

Conditional:

  • Required if not specified in the configuration
  • If mode is set to key-files, requires <private-key-file> and <certificate-file>
  • If mode is set to key-data, requires <private-key-data> and <certificate-data>
<operation-name>

Contains the name of the operation: create-vpc

Yes

<parameters>

Contains the elements required to execute the operation

Yes

<cidr-block>

Specifies the CIDR block that you want the VPC to cover (for example, 10.0.0.0/16)

Yes

<instance-tenancy>

Specifies the allowed tenancy of instances launched into the VPC

Valid values:

  • default (instances can be launched with any tenancy) (default)
  • dedicated (instances must be launched with tenancy as 'dedicated')

No

The following figure shows a sample adapter request for the Create VPC operation. 

Sample adapter request for the Create VPC operation

<amazon-ec2-request>
   <wsdl-location>http://ec2.amazonaws.com/doc/2011-02-28/</wsdl-location>
   <endpoint-address>http://us-east-1.ec2.amazonaws.com/</endpoint-address>
   <signature-properties mode = "key-files">
       <private-key-file>C:\Security\
pk-MJ5GIUNLM2XJ3VRJSYTKOFDWILELDQHB.PEM</private-key-file>
       <certificate-file>C:\Security\
cert-MJ5GIUNLM2XJ3VRJSYTKOFDWILELDQHB.PEM</certificate-file>
   </signature-properties>
   <operation-name>create-vpc</operation-name>
   <parameters>
     <cidr-block>10.0.0.0/24</cidr-block>
     <!--Optional:-->
     <instance-tenancy>default</instance-tenancy>
   </parameters>
</amazon-ec2-request>

The following figure shows the response for the sample Create VPC operation. 

Sample adapter response for the Create VPC operation

<amazon-ec2-response>
 <metadata>
   <status>success</status>
 </metadata>
 <CreateVpcResponse>
   <requestId>297679fe-cc6e-4701-9dbd-0e84a55c41ed</requestId>
   <vpc>
     <vpcId>vpc-daa184b3</vpcId>
     <state>pending</state>
     <cidrBlock>10.0.0.0/24</cidrBlock>
     <dhcpOptionsId>dopt-07defb6e</dhcpOptionsId>
     <instanceTenancy>default</instanceTenancy>
   </vpc>
 </CreateVpcResponse>
</amazon-ec2-response>

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*