title: How do I resolve access denied aws s3 files?
body: <p>Im trying to make files on my s3 bucket (CSS JS files) accessible to a Django application running in heroku.</p>
  
  <p>I think I have the settings.py configured correctly.</p>
  
  <p>However when I try to make changes to permissions in the S3 bucket i get access denied.
  <a href="https://i.stack.imgur.com/lBNaj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lBNaj.png" alt="Access denied error"></a></p>
  
  <p>I added cors and bucket policy is set to public.</p>
  
  <p>Ultimately when I load the application from heroku Im getting 403 errors when trying to access the static files.</p>
  
  <p>Bucket policy:</p>
  
  <pre><code>{
      "Version": "2012-10-17",
      "Statement": [
          {
              "Sid": "AddPerm",
              "Effect": "Allow",
              "Principal": {
                  "AWS": "*"
              },
              "Action": "s3:*",
              "Resource": "arn:aws:s3:::NameOfBucket/*"
          }
      ]
  }
  </code></pre>
  
  <p>CORs configuration: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"&gt;
  &lt;CORSRule&gt;
      &lt;AllowedOrigin&gt;*&lt;/AllowedOrigin&gt;
      &lt;AllowedMethod&gt;GET&lt;/AllowedMethod&gt;
      &lt;MaxAgeSeconds&gt;3000&lt;/MaxAgeSeconds&gt;
      &lt;AllowedHeader&gt;Authorization&lt;/AllowedHeader&gt;
  &lt;/CORSRule&gt;
  &lt;/CORSConfiguration&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/2vxaw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2vxaw.png" alt="public access settings"></a>
  How can I get the permissions to make changes in the s3 bucket please?</p>