Make a bucket public in Amazon S3

ID : 10184

viewed : 28

Tags :

Top 5 Answer for Make a bucket public in Amazon S3

vote vote

95

You can set a bucket policy as detailed in this blog post:

http://ariejan.net/2010/12/24/public-readable-amazon-s3-bucket-policy/


As per @robbyt's suggestion, create a bucket policy with the following JSON:

{   "Version": "2008-10-17",   "Statement": [{     "Sid": "AllowPublicRead",     "Effect": "Allow",     "Principal": { "AWS": "*" },     "Action": ["s3:GetObject"],     "Resource": ["arn:aws:s3:::bucket/*" ]   }] } 

Important: replace bucket in the Resource line with the name of your bucket.

vote vote

89

Amazon provides a policy generator tool:

https://awspolicygen.s3.amazonaws.com/policygen.html

After that, you can enter the policy requirements for the bucket on the AWS console:

https://console.aws.amazon.com/s3/home

vote vote

76

I got this working by hard setting the attribute. And controlling the attribute applicability using the boolean value for the attribute.

Here is the code snippet:

<div contenteditable="{{ condition ? 'true' : 'false'}}"></div> 

I hope this helps.

vote vote

68

In the latest version of Angular (1.1.5), they have included a conditional directive called ngIf. It is different from ngShow and ngHide in that the elements aren't hidden, but not included in the DOM at all. They are very useful for components which are costly to create but aren't used:

<h1 ng-if="editMode" contenteditable=true>{{content.title}}</h1> 
vote vote

51

To get an attribute to show a specific value based on a boolean check, or be omitted entirely if the boolean check failed, I used the following:

ng-attr-example="{{params.type == 'test' ? 'itWasTest' : undefined }}"

Example usage:

<div ng-attr-class="{{params.type == 'test' ? 'itWasTest' : undefined }}">

Would output <div class="itWasTest"> or <div> based on the value of params.type

Top 3 video Explaining Make a bucket public in Amazon S3

Related QUESTION?