409
社区成员
发帖
与我相关
我的任务
分享
import os
os.system('aws configure set access_key {} --profile {}'.format(my_access_key, profile_name))
os.system('aws configure set secret_key {} --profile {}'.format(my_secret_key, profile_name))
os.system('aws configure set signature_version s3v4 --profile {}'.format(profile_name))
os.system("aws s3 presign {} --expires-in 604800 > public_url --profile {}".format(s3_path, profile_name))
执行 aws s3 presign {} --expires-in 604800 后会生成一个新的链接,你是用生成的链接访问,还是S3给出的链接?
生成的链接像这样
https://examplebucket.s3.amazonaws.com/test2.txt?AWSAccessKeyId=AKIAEXAMPLEACCESSKEY&Signature=EXHCcBe%EXAMPLEKnz3r8O0AgEXAMPLE&Expires=1556132848