3
=======================================
4
An Introduction to boto's VPC interface
5
=======================================
7
This tutorial is based on the examples in the Amazon Virtual Private
8
Cloud Getting Started Guide (http://docs.amazonwebservices.com/AmazonVPC/latest/GettingStartedGuide/).
9
In each example, it tries to show the boto request that correspond to
10
the AWS command line tools.
12
Creating a VPC connection
13
-------------------------
14
First, we need to create a new VPC connection:
16
>>> from boto.vpc import VPCConnection
17
>>> c = VPCConnection()
21
Now that we have a VPC connection, we can create our first VPC.
23
>>> vpc = c.create_vpc('10.0.0.0/24')
32
>>> vpc.dhcp_options_id
38
The next step is to create a subnet to associate with your VPC.
40
>>> subnet = c.create_subnet(vpc.id, '10.0.0.0/25')
47
>>> subnet.available_ip_address_count
49
>>> subnet.availability_zone
53
To create a customer gateway
54
----------------------------
55
Next, we create a customer gateway.
57
>>> cg = c.create_customer_gateway('ipsec.1', '12.1.2.3', 65534)
70
To create a VPN gateway
71
-----------------------
73
>>> vg = c.create_vpn_gateway('ipsec.1')
80
>>> vg.availability_zone
84
Attaching a VPN Gateway to a VPC
85
--------------------------------