Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从AWS检索S3存储桶列表时出错:访问被拒绝wordpress_Wordpress_Amazon Web Services_Amazon S3_Amazon Cloudfront - Fatal编程技术网

从AWS检索S3存储桶列表时出错:访问被拒绝wordpress

从AWS检索S3存储桶列表时出错:访问被拒绝wordpress,wordpress,amazon-web-services,amazon-s3,amazon-cloudfront,Wordpress,Amazon Web Services,Amazon S3,Amazon Cloudfront,我在wordpress中遇到这个错误:从AWS检索S3存储桶列表时出错:拒绝访问。我已为IAM用户编写策略。我不知道我哪里做错了。请帮帮我 我的IAM政策如下: { "Version": "2012-10-17", "Statement": [ { "Sid": "Stmtxxxxxxxxxxx", "Effect": "Allow", "Action": [ "s3:GetBucketLocation", "s

我在wordpress中遇到这个错误:
从AWS检索S3存储桶列表时出错:拒绝访问
。我已为IAM用户编写策略。我不知道我哪里做错了。请帮帮我

我的IAM政策如下:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmtxxxxxxxxxxx",
      "Effect": "Allow",
      "Action": [
        "s3:GetBucketLocation",
        "s3:ListBucket",
        "s3:ListBucketMultipartUploads"
      ],
      "Resource": [
        "arn:aws:s3:::bucketname/*"
      ]
    }
  ]
}

首先,为了列出所有存储桶,您需要创建一条语句,允许IAM在整个s3帐户中执行“s3:ListAllMyBucket”

{
“效果”:“允许”,
“操作”:“s3:ListAllMyBucket”,
“资源”:“*”,
“条件”:{}
}

此外,似乎您在存储桶列表方面遇到了问题,因为您尝试允许的操作:


“行动”:[
“s3:GetBucketLocation”,
“s3:ListBucket”,
“s3:ListBucketMultiportupLoads”
],

必须应用于整个铲斗:

“资源”:“arn:aws:s3:::bucketname”,

当您尝试允许对bucket的内容执行此操作时:

“资源”:“arn:aws:s3:::bucketname/*”,

无论如何,请尝试以下策略:

{
“版本”:“2012-10-17”,
“声明”:[
{
“Sid”:“stmtxxxxxxxxxx”,
“效果”:“允许”,
“行动”:[
“s3:GetBucketLocation”,
“s3:ListBucket”,
“s3:ListBucketMultiportupLoads”
],
“资源”:“arn:aws:s3:::bucketname”,
“条件”:{}
},
{
“效果”:“允许”,
“操作”:“s3:ListAllMyBucket”,
“资源”:“*”,
“条件”:{}
}
]
}

我在我的网站上进行了测试,效果良好

如果您还有其他问题,请随时提问

谢谢,
弗拉德

谢谢你。实际上我忘了给用户一个管理权限。现在一切都好了。