如何在 S3 中公开 10,000 个文件 [英] How to make 10,000 files in S3 public

查看:24
本文介绍了如何在 S3 中公开 10,000 个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个包含 10,000 个文件的存储桶中有一个文件夹.似乎没有办法上传它们并立即公开它们.所以我把它们都上传了,它们是私人的,我需要把它们全部公开.

I have a folder in a bucket with 10,000 files. There seems to be no way to upload them and make them public straight away. So I uploaded them all, they're private, and I need to make them all public.

我已经尝试过 aws 控制台,它只是给出了一个错误(适用于文件较少的文件夹).

I've tried the aws console, it just gives an error (works fine with folders with less files).

我试过在 Firefox 中使用 S3 组织,同样的事情.

I've tried using S3 organizing in Firefox, same thing.

我可以运行一些软件或脚本来公开所有这些吗?

Is there some software or some script I can run to make all these public?

推荐答案

您可以生成一个存储桶策略(参见下面的示例),它可以访问存储桶中的所有文件.可以通过 AWS 控制台将存储桶策略添加到存储桶中.

You can generate a bucket policy (see example below) which gives access to all the files in the bucket. The bucket policy can be added to a bucket through AWS console.

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

另请参阅 Amazon 提供的以下策略生成器工具.

Also look at following policy generator tool provided by Amazon.

http://awspolicygen.s3.amazonaws.com/policygen.html

这篇关于如何在 S3 中公开 10,000 个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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