Mobile app version of vmapp.org
Login or Join
Tiffany637

: Having Json Errors for Two Amazon S3 Bucket Policies I am having issues pasting two bucket policies in one file (pop up window where you paste the bucket policy in amazon s3). I want to use

@Tiffany637

Posted in: #AmazonS3

I am having issues pasting two bucket policies in one file (pop up window where you paste the bucket policy in amazon s3).

I want to use two policies


Make bucket public so that it can be accessed in a browser.
Use a policy that disables hotlinking.


Now the problem is that I can only put either one of the policies inside the policy pop up window.

If I put both the policies one after another, it gives me a syntax error or wrong Json error.

Can a webmaster please post the correct syntax to put in the popup window that makes a bucket public but also disables hotlinking?

These are the two policies I am putting the popup window:

{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::my-brand-new-bucket/*"
]
}
]
}
{
"Version": "2008-10-17",
"Id": "preventHotLinking",
"Statement": [
{
"Sid": "1",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-brand-new-bucket/*",
"Condition": {
"StringLike": {
"aws:Referer": [
"http://yourwebsitename.com/*",
"http://www.yourwebsitename.com/*"
]
}
}
}
]
}


But when I put the above code inside the policy popup window, it gives me json syntax error.

Thank you very much!

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Tiffany637

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme