amazon web services - S3 bucket policy: allow full access to a bucket and all its objects -
i bucket policy allows access objects in bucket, , operations on bucket listing objects. (action s3:*
.)
i able solve using 2 distinct resource names: 1 arn:aws:s3:::examplebucket/*
, 1 arn:aws:s3:::examplebucket
.
is there better way - there way specify resource identifier refers bucket , contained objects, in 1 shot?
permissions against bucket separate permissions against objects within bucket. therefore, must grant permissions both.
fortunately, can write shorter version combine bucket-level , object-level permissions:
{ "id": "bucketpolicy", "version": "2012-10-17", "statement": [ { "sid": "allaccess", "action": "s3:*", "effect": "allow", "resource": [ "arn:aws:s3:::my-bucket", "arn:aws:s3:::my-bucket/*" ], "principal": "*" } ] }
Comments
Post a Comment