我正在尝试通过 aws cli 运行 S3 复制操作。要复制的对象很大 - 它是一个约 9GB 的文件。
aws cli s3 cp s3://${my_bucket}/${my_file}
我收到以下错误:
download failed: s3://... to .. An error occurred (SignatureDoesNotMatch) when calling the GetObject operation: The request signature we calculated does not match the signature you provided. Check your key and signing method.
当我尝试在同一个存储桶上运行列表操作时,没有错误。
我已验证 IAM 角色有权访问 S3 存储桶,并且具有 ls 和 cp 权限。
错误消息与实际的底层错误不符。
真正的问题是被复制的对象太大。对于我的情况,当 cp 操作开始时,我可以识别这种模式,并且出现进度条,但由于错误而突然停止。
这个命令为我解决了这个问题:
aws configure set default.s3.multipart_threshold 10GB
以下问题提到了这一点: