在Amazon S3上,我可以给单个对象的下载权,但不能为整个斗 [英] On Amazon S3 I'm able to give an individual object download rights but cannot for the entire bucket

查看:92
本文介绍了在Amazon S3上,我可以给单个对象的下载权,但不能为整个斗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有在S3上的图像,我想用我的Rails应用程序共享。我可以访问到的图像通过设置权限:每个人 - 在S3 UI打开/下载。我要将此权限桶中的所有对象。桶允许用户界面不会有打开/下载供用户选择。什么是动作我需要在水桶config命令指定允许这样做?这是我目前的命令:

  {


版本:2008-10-17,
    ID:ANID
    声明: [
        {
            锡德:ansid
            效果:允许,
            主要: {
                AWS:*
            },
            行动:S3:GetObject的,
            资源:ARN:AWS:S3 :::憔悴/ AKEY
        }
    ]
}
 

解决方案

您政策可能是错误的,这个人是工作的罚款为大家(匿名)用户:

  {
  ID:Policy1416915063227
  声明: [
    {
      锡德:AddCannedAcl
      行动: [
        S3:GetObject的
      ]
      效果:允许,
      资源:ARN:AWS:S3 ::: examplebucket / *,
      主要: {
        AWS:[
          *
        ]
      }
    }
  ]
}
 

我建议使用策略生成通过以下链接: http://awspolicygen.s3.amazonaws.com/policygen.html

I've got images on S3 that I'd like to share with my Rails app. I can get access to the images by setting the permission: Everybody - Open/Download on the S3 UI. I want to set this permission for all objects in the bucket. The bucket permission UI doesn't have the option of Open/Download for users. What is the action I need to assign in the bucket config command to allow this? Here is my current command:

{


"Version": "2008-10-17",
    "Id": "anid",
    "Statement": [
        {
            "Sid": "ansid",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::haggard/akey"
        }
    ]
}

解决方案

Your policy is probably wrong, this one is working fine for Everyone (Anonymous) users:

{
  "Id": "Policy1416915063227",
  "Statement": [
    {
      "Sid": "AddCannedAcl",
      "Action": [
        "s3:GetObject"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::examplebucket/*",
      "Principal": {
        "AWS": [
          "*"
        ]
      }
    }
  ]
}

I recommend to use the policy generator at the following link: http://awspolicygen.s3.amazonaws.com/policygen.html

这篇关于在Amazon S3上,我可以给单个对象的下载权,但不能为整个斗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆