``` from boto.s3.connection import S3Connection from boto.sts.connection import STSConnection sts_conn = STSConnection(aws_access_key_id=self._secret_id, aws_secret_access_key=self._access_key) # get limited privilege by policy federation_token = sts_conn.get_federation_token(user_name, duration=duration, policy=policy) sts_conn.close() s3conn = S3Connection(federation_token.credentials.access_key, federation_token.credentials.secret_key, security_token=federation_token.credentials.session_token) upload_url = s3conn.generate_url(duration, 'PUT', bucket_name, object_key) s3conn.close() ```
http://docs.aws.amazon.com/IAM/latest/UserGuide/id...
http://docs.aws.amazon.com/IAM/latest/UserGuide/id...
全站熱搜
留言列表