对 Amazon 上的 S3 文件夹的只读访问权限 [英] Read-Only access to S3 folder on Amazon

查看:107
本文介绍了对 Amazon 上的 S3 文件夹的只读访问权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为 Amazon 上的特定文件夹设置只读访问权限.我有一个公司"存储桶和文件夹软件".出于某种原因,以下代码对我不起作用(我使用 CloudBerry 进行验证):

I'm trying to set Read-Only access to a specific folder on Amazon. I have a 'corporate' bucket and folder 'software' inside it. For some reason the following code doesn't work for me (I'm using CloudBerry for the verification):

{
    "Statement": [
    {
        "Effect": "Allow",
        "Action": [
            "s3:Get*",
            "s3:List*"
        ],
        "Resource": "arn:aws:s3:::corporate/software/*"
    }
    ]
}

但是如果我使用:

"Resource": "*"

我能看到所有的桶...我错过了什么吗?

I'm able to see all the buckets... Am I missing something?

推荐答案

以下代码对我有用:

{
    "Statement": [
{
    "Effect": "Allow",
    "Action": [
        "s3:ListBucket",
        "s3:GetBucketLocation",
        "s3:ListBucketMultipartUploads"
    ],
    "Resource": "arn:aws:s3:::corporate",
    "Condition": {}
    },
    {
    "Effect": "Allow",
    "Action": [
        "s3:GetObject",
        "s3:GetObjectAcl",
        "s3:GetObjectVersion",
        "s3:GetObjectVersionAcl"
    ],
    "Resource": "arn:aws:s3:::corporate/software/*",
    "Condition": {}
    },
    {
        "Effect": "Allow",
        "Action": "s3:ListAllMyBuckets",
        "Resource": "*",
        "Condition": {}
    }
]
}

这篇关于对 Amazon 上的 S3 文件夹的只读访问权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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