InvalidRequest-S3 LS [英] InvalidRequest - s3 ls
问题描述
我无法在s3存储桶中运行ls,当我调用"aws s3 ls s3://bar"时,出现以下错误消息:
I am unable to ls in an s3 bucket, when I call "aws s3 ls s3://bar" I get the following error message:
调用ListObjects操作时发生错误(InvalidRequest):此请求缺少必需的标头:x-amz-content-sha256
An error occurred (InvalidRequest) when calling the ListObjects operation: Missing required header for this request: x-amz-content-sha256
这是我的政策
{
"Id": "foo",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "foo",
"Action": "s3:*",
"Effect": "Allow",
"Resource": "arn:aws:s3:::bar",
"Principal": {
"AWS": [
"arn:aws:iam::foo"
]
}
}
]
}
推荐答案
我无法重现您的示例,因为您的委托人的ARN格式错误.那可能是造成您问题的原因. 您应该使用以下格式: arn:aws:iam :: 123456789012:user/foo
I cannot reproduce your example because your ARN of your principal is malformed. That could be the cause of your issue. You should use the following format: arn:aws:iam::123456789012:user/foo
您的帐号在123456789012(如果在aws控制台的支持部分的右上方,可以找到它)
Where 123456789012 is your account number (you can find it if on the support section of the aws console, on the top right)
或者,您可以在用户页面顶部的AWS控制台/IAM中查看IAM用户的确切ARN.
Alternatively, you can see the exact ARN of your IAM user in AWS console/IAM, at the top of your user page.
这篇关于InvalidRequest-S3 LS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!