title: Cannot set bucket policy of amazon s3
body: <p>I was simply following the "get started"  tutorial <a href="https://aws.amazon.com/getting-started/projects/build-serverless-web-app-lambda-apigateway-s3-dynamodb-cognito/module-1/" rel="nofollow noreferrer">here</a></p>
  
  <p>But I failed at "Step 4 Add a Bucket Policy to Allow Public Reads". It always complains "access denied" with a red error icon.</p>
  
  <p>I am not able to set it via command line either. Here is the command I use:</p>
  
  <blockquote>
    <p>aws s3api put-bucket-policy --bucket bucket-name --policy
    file://bucket-policy.json</p>
  </blockquote>
  
  <p>Here is the error I got:</p>
  
  <blockquote>
    <p>An error occurred (AccessDenied) when calling the PutBucketPolicy
    operation: Access Denied</p>
  </blockquote>