```
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...

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 JohnDX 的頭像
    JohnDX

    我要回家想一想~

    JohnDX 發表在 痞客邦 留言(0) 人氣()