if you want to restrict images, pdf or any content to be read just from an specific domain name do this creating a new policy for your S3 Bucket
{ "Version": "2012-10-17", "Id": "http referer policy example", "Statement": [ { "Sid": "Allow get requests originating from www.yourdomain.co and yourdomain.co.", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::9rswfqxn/*", "Condition": { "StringLike": { "aws:Referer": [ "https://www.yourdomain.co/*", "https://yourdomain.co/*" ] } } } ] }
|
no if the contrary you want to open access to anybody to read your content in your s3 bucket do this
{ "Version": "2008-10-17", "Id": "Policy-id", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::yourbucketname/*", "Condition": {} } ] }
|
Comments
Post a Comment