I'm a complete noob with Python and boto and trying to establish a basic connection to ec2 services. I'm running the following code:
ec2Conn = boto.connect_ec2('username','password')
group_name = 'python_central'
description = 'Python Central: Test Security Group.'
group = ec2Conn.create_security_group(group_name, description)
group.authorize('tcp', 8888,8888, '<a href="http://0.0.0.0/0">0.0.0.0/0</a>')
and getting the following error: AWS was not able to validate the provided access credentials
I've read some posts that this might be due to time difference between my machine and the EC2 server but according to the logs, they are the same:
host:ec2.us-east-1.amazonaws.com x-amz-date:20161213T192005Z
host;x-amz-date 515db222f793e7f96aa93818abf3891c7fd858f6b1b9596f20551dcddd5ca1be 2016-12-13 19:20:05,132 boto [DEBUG]:StringToSign:
Any idea how to get this connection running?
Thanks!
bototo launch instances, not connect to instances. Do you want tosshinto the instance you created?usernameandpasswordfrom? The AWS API doesn't take a username/password, it takes an access key and secret key. You appear to be confusing AWS API access and EC2 SSH access.