简体   繁体   中英

AWS mediastore java sdk 2 - enable public access

我想在我的 mediastore 容器中启用对对象的公共访问,例如在 s3 ... s3Client.createBucket(CreateBucketRequest .builder() .bucket(bucketName).acl(BucketCannedACL.PUBLIC_READ).acl(BucketCannedACL.PUBLIC_READ_WRITE) .. .

To enable public access, you need to add a stanza to the Container Policy. The additional stanza will resemble this example below. Modify it using your AWS account number, region, and container name in the Resource ARN.

{
      "Sid": "PublicReadOverHttps",
      "Effect": "Allow",
      "Principal": "*",
      "Action": [
        "mediastore:GetObject",
        "mediastore:DescribeObject"
      ],
      "Resource": "arn:aws:mediastore:myregion:9999999999:container/MyContainer/*",
      "Condition": {
        "Bool": {
          "aws:SecureTransport": "true"
        }
      }
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM