Reputation: 33
Here is the attempt I have made and the output(interlaced).
from boto.ec2.connection import EC2Connection
v = EC2Connection()
v
EC2Connection:ec2.us-east-1.amazonaws.com
v.create_key_pair('somePair')
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/boto/ec2/connection.py", line 2306, in create_key_pair
return self.get_object('CreateKeyPair', params, KeyPair, verb='POST')
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 1096, in get_object raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 403 Forbidden
UnauthorizedOperation
You are not authorized
to perform this operation.43b2cb82-33e4-4294-bf76-387be9c50dc1
Upvotes: 0
Views: 1535
Reputation: 33
The answer in this thread did the trick for me. I was using EC2Connection() without passing it the aws_access_key_id and aws_secret_access_key since I had set them up in environ variables. I read it somewhere that this function would pick them up. I wonder how it returned a successful connection. Perhaps, no authentication is done at the point of connecting to aws.
Upvotes: 0