I didn't know how to specify the region when making a connection, so make a note. Or rather, I looked it up and it didn't work. .. ..
connection.py
#!/usr/bin/python
# coding: utf8
from boto.ec2 import EC2Connection
# defaults region
EC2Connection.DefaultRegionName = 'ap-northeast-1'
EC2Connection.DefaultRegionEndpoint = 'ec2.ap-northeast-1.amazonaws.com'
conn = EC2Connection(
aws_access_key_id = 'XXXXXXXXXXXX',
aws_secret_access_key = 'YYYYYYYYYYY')
print conn.get_all_instances()
Click here for regions and endpoints (http://docs.amazonwebservices.com/general/latest/gr/rande.html)
It seems that this is all.
Recommended Posts