0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

S3バケットをバブリングにするが、下位フォルダの一部は制限をかけたい

Last updated at Posted at 2019-08-30

#問題
アクセス制限違いでバケットを分けたくない

#こうした

  • アクセス権限→バケットポリシー

  • hoge/download

  • hoge/content

  • hoge/private <- ここはパブリックにしたくない

{
    "Version": "2008-10-17",
    "Statement": [
        {
            "Sid": "PublicReadForGetBucketObjects",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:GetObject",
            "Resource": [
                "arn:aws:s3:::hoge/download/*",
                "arn:aws:s3:::hoge/content/*"
            ]
        }
    ]
}
  • hoge/private は"Resource"に記載しないこと

#メモ
パブリックにしたバケットがあると、awsから親切にお知らせが来る

We’re writing to notify you that your AWS account xxxxxx has one or more S3 buckets that allow read or write access from any user on the Internet. By default, S3 buckets allow only the account owner to access the contents of a bucket; however, customers can configure S3 buckets to permit public access.
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?