为S3 Object Lambda生成预签名URL

0

【以下的问题经过翻译处理】 最近发布了S3 Object Lambda,我认为这真的很酷。我需要一个可行的方法,可以使用S3 Object Lambda通过get_object BOTO3方法检索对象。当直接在存储桶上生成预签名URL也可以正常工作。但是,当我尝试为S3 Object Lambda生成预签名URL时,代码如下: url = s3.generate_presigned_url("get_object", Params={ "Bucket": "arn:aws:s3-object-lambda:eu-west-1:account-id:accesspoint/my-object-lambda", "Key": "filename.txt", }) 我得到了以下错误:

<?xml version="1.0" encoding="UTF-8"?><Error xmlns=""><Code>MissingAuthenticationToken</Code><Message>Missing authentication token.</Message><RequestId>REDACTED</RequestId><HostId>{host-id}</HostId></Error>

这个操作目前不起作用吗?

编辑者:Paulvdb于2021年3月31日上午11:17修改

profile picture
EXPERT
asked 3 years ago69 views
1 Answer
0

【以下的回答经过翻译处理】 你好Paulvdb,

很高兴听到你喜欢S3 Object Lambda。我认为Boto3在预签名请求时默认使用Signature Version 2。你可以尝试在创建S3客户端时将签名版本设置为SigV4,看看是否有帮助。

类似这样:

s3 = boto3.client('s3',config = Config(signature_version ='s3v4'))

profile picture
EXPERT
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions