我正在使用这段代码,这很简单,但它不起作用。任何想法为什么?如果您有凭据,您应该能够运行它。
from boto.s3.connection import S3Connection
import boto
import json
iam = boto.connect_iam(main_aws_id,main_aws_key)
iam.create_group('test_admin')
create_admin_policy = {"Statement":[{"Effect":"Allow","Action":"*", "Resource":"*"}]}
admin_policy=json.dumps(create_admin_policy)
iam.put_group_policy('test_admin', 'AdminPolicy', admin_policy)
iam.create_user('harry')
iam.add_user_to_group('test_admin', 'harry')
key_response=iam.create_access_key('harry')
a=json.dumps(key_response).split(',') #my way of getting user's id and key
user_AWS_ID=a[4][19:-3]
user_AWS_KEY=a[3][23:-3]
#needs a bit of time for the key to activates
user_conn=S3Connection(user_AWS_ID,user_AWS_KEY)
user_conn.create_bucket('harry_bucket') #returns: 403 Forbidden. the request signature we calculated does not match the signature you provided