VPC_Operations for Amazon EC2 adapter
This section illustrates the adapter requests and responses for Virtual Private Cloud (VPC) operations.
Create VPC operation
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
<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 | Conditional:
|
<endpoint-address> | Specifies the web service endpoint for the adapter to use while performing operations on Amazon EC2 instances across different regions | No |
<signature-properties> | Specifies the mode for signing the adapter request | Conditional:
|
<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
| No |
The following figure shows a sample adapter request for the Create VPC operation.
Sample adapter request for the Create VPC operation
<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
<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>
Delete VPC operation
The Delete VPC operation enables you to delete a VPC. You must first detach or delete all gateways or other objects that depend on the VPC. For example, you must terminate all running instances, delete all VPC security groups (except the default), delete all the route tables (except the default), and so on before deleting the VPC.
The following figure shows a sample <items> XML element for the Delete VPC operation.
Sample <items> XML element for the Delete VPC operation
<item>
<parameters>
<vpc-id></vpc-id>
</parameters>
</item>
</items>
The following table describes the elements for this adapter request.
Adapter request elements for the Delete VPC operation
Element | Definition | Required |
---|---|---|
<wsdl-location> | Specifies the target Web Service Description Language (WSDL) URL for Amazon EC2 | Conditional:
|
<endpoint-address> | Specifies the web service endpoint for the adapter to use while performing operations on Amazon EC2 instances across different regions | No |
<signature-properties> | Specifies the mode for signing the adapter request | Conditional:
|
<operation-name> | Contains the name of the operation: delete-vpc | Yes |
<parameters> | Contains the <vpc-id> element required to execute the operation | Yes |
<vpc-id> | Specifies the ID of the VPC that you want to delete | Yes |
The following figure shows a sample adapter request for the Delete VPC operation.
Sample adapter request for the Delete VPC operation
<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>delete-vpc</operation-name>
<parameters>
<vpc-id>vpc-daa184b3</vpc-id>
</parameters>
</amazon-ec2-request>
The following figure shows the response for the sample Delete VPC operation.
Sample adapter response for the Delete VPC operation
<metadata>
<status>success</status>
</metadata>
<DeleteVpcResponse>
<requestId>31d15881-c163-4555-b19b-9812b35255dc</requestId>
<return>true</return>
</DeleteVpcResponse>
</amazon-ec2-response>
Describe VPCs operation
The Describe VPCs operation enables you to retrieve information about your VPCs.
You can filter the results to return information only about those VPCs that match the criteria that you specify. For example, you could get information only about VPCs whose state is available. Also, you can specify multiple values for the filter. For example, the VPC uses one of several sets of DHCP options and the state of the VPC isavailable. However, at least one of the specified values must match a VPC to obtain results.
The result includes information for a particular VPC only if it matches all the specified filters. If there is no match, no special message is returned; the response is empty.
You can use wildcard characters with the filters:
- Use the asterisk (*) to match any number of characters.
- Use the question mark (?) to match a single character.
To escape a special character or metacharacter that has a special meaning in searches, precede the special character with a backslash (\ ).
The following table shows the available filters.
Filter Name | Description |
---|---|
cidr | Specifies the CIDR block of the VPC |
dchp-options-id | Specifies the ID for a set of DHCP options |
state | Specifies the state of the VPC |
tag-key | Species the key assigned to a resource |
tag-value | Specifies the value of the tag assigned to the resource |
Filters the results based on a specific tag-value combination | |
vpc-id | Specifies the ID of the VPC |
The following figure shows a sample <items> XML element for the Describe VPCs operation.
Sample <items> XML element for the Describe VPCs operation
<item>
<parameters>
<!--Optional:-->
<vpc-set>
<!--Zero or more repetition-->
<item>
<vpc-id></vpc-id>
</item>
</vpc-set>
<!--Optional:-->
<filter-set>
<!--Zero or more repetition-->
<item>
<name></name>
<value-set>
<!--Zero or more repetition-->
<item>
<value></value>
</item>
</value-set>
</item>
</filter-set>
</parameters>
</item>
</items>
The following table describes the elements for this adapter request.
Adapter request elements for the Describe VPCs operation
Element | Definition | Required |
---|---|---|
<wsdl-location> | Specifies the target Web Service Description Language (WSDL) URL for Amazon EC2 | Conditional:
|
<endpoint-address> | Specifies the web service endpoint for the adapter to use while performing operations on Amazon EC2 instances across different regions | No |
<signature-properties> | Specifies the mode for signing the adapter request | Conditional:
|
<operation-name> | Contains the name of the operation: describe-vpcs | Yes |
<parameters> | Contains the elements required to execute the operation | Yes |
<vpc-set> | Specifies the details of the VPC IDs whose information you want to retrieve | No |
<filter-set> | Specifies the details of the filter that is used to retrieve specific information | No |
The following figure shows a sample adapter request for the Describe VPCs operation using cidr as a filter.
Sample adapter request for the Describe VPCs operation
<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>describe-vpcs</operation-name>
<parameters>
<vpc-set>
<item>
<vpc-id>vpc-b950e6d0</vpc-id>
</item>
</vpc-set>
<filter-set>
<item>
<name>cidr</name>
<value-set>
<item>
<value>10.0.0.0/16</value>
</item>
</value-set>
</item>
</filter-set>
</parameters>
</amazon-ec2-request>
The following figure shows the response for the sample Describe VPCs operation using cidr as a filter.
Sample adapter response for the Describe VPCs operation
<metadata>
<status>success</status>
</metadata>
<DescribeVpcsResponse>
<requestId>f4338ee0-8a41-4fdc-a081-f197cb78d1d4</requestId>
<vpcSet>
<item>
<vpcId>vpc-b950e6d0</vpcId>
<state>available</state>
<cidrBlock>10.0.0.0/16</cidrBlock>
<dhcpOptionsId>dopt-5eac8937</dhcpOptionsId>
<instanceTenancy>default</instanceTenancy>
</item>
</vpcSet>
</DescribeVpcsResponse>
</amazon-ec2-response>
The following figure shows a sample adapter request for the Describe VPCs operation using state as a filter.
<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>describe-vpcs</operation-name>
<parameters>
<filter-set>
<item>
<name>state</name>
<value-set>
<item>
<value>available</value>
</item>
</value-set>
</item>
</filter-set>
</parameters>
</amazon-ec2-request>
The following figure shows the response for the sample Describe VPCs operation using state as a filter
<metadata>
<status>success</status>
</metadata>
<DescribeVpcsResponse>
<requestId>f4338ee0-8a41-4fdc-a081-f197cb78d1d4</requestId>
<vpcSet>
<item>
<vpcId>vpc-b950e6d0</vpcId>
<state>available</state>
<cidrBlock>10.0.0.0/16</cidrBlock>
<dhcpOptionsId>dopt-5eac8937</dhcpOptionsId>
<instanceTenancy>default</instanceTenancy>
</item>
</vpcSet>
</DescribeVpcsResponse>
</amazon-ec2-response>
The following figure shows a sample adapter request for the Describe VPCs operation using tag-key as a filter.
<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>describe-vpcs</operation-name>
<parameters>
<filter-set>
<item>
<name>tag-key</name>
<value-set>
<item>
<value>Name</value>
</item>
</value-set>
</item>
</filter-set>
</parameters>
</amazon-ec2-request>
The following figure shows the response for the sample Describe VPCs operation using tag-ey as a filter.
<metadata>
<status>success</status>
</metadata>
<DescribeVpcsResponse>
<requestId>f4338ee0-8a41-4fdc-a081-f197cb78d1d4</requestId>
<vpcSet>
<item>
<vpcId>vpc-b950e6d0</vpcId>
<state>available</state>
<cidrBlock>10.0.0.0/16</cidrBlock>
<dhcpOptionsId>dopt-5eac8937</dhcpOptionsId>
<instanceTenancy>default</instanceTenancy>
</item>
</vpcSet>
</DescribeVpcsResponse>
</amazon-ec2-response>