Created
December 18, 2015 10:46
-
-
Save elbertwang/cad02ae7e21b1bcd698f to your computer and use it in GitHub Desktop.
describe_ec2_vpc_boto2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from boto import vpc | |
connvpc = vpc.connect_to_region('cn-north-1') | |
vpcs = connvpc.get_all_vpcs() | |
subnets = connvpc.get_all_subnets() | |
print vpcs | |
print subnets | |
for vpc in vpcs: | |
print vpc | |
for vpc_subnet in connvpc.get_all_subnets(filters={"vpcId":vpc.id}): | |
print vpc_subnet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment