Domanda

I'm trying to use autoscale module from boto. I reach to create an API connexion and get all groups in the default region(us-east-1).

 conn = AutoScaleConnection(ACCESS_KEY,SECRET_KEY)
 print conn.get_all_groups()

Now I need to create a connexion on the region eu-west-1, but I've always an error.

conn = AutoScaleConnection(ACCESS_KEY,SECRET_KEY)
autoscale = boto.ec2.autoscale.connect_to_region('eu-west-1')

Error:

boto.exception.NoAuthHandlerFound: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV4Handler'] Check your credentials

If I try with that:

autoscale = boto.ec2.autoscale.connect_to_region('eu-west-1',ACCESS_KEY,SECRET_KEY)

Error:

TypeError: connect_to_region() takes exactly 1 argument (3 given)

È stato utile?

Soluzione

You have to pass additional parameters as keyword parameters, e.g.:

boto.ec2.autoscale.connect_to_region('us-west-2', aws_access_key_id=ACCESS_KEY, aws_secret_access_key=SECRET_KEY)

Alternatively, you could put your credentials in a boto config file (~/.boto) or in environment variables and boto will find them.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top