title: S3 Bucket Policy for Hosted Static Website
body: <p>I have an S3 bucket that is being used to host a static website. <a href="http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteAccessPermissionsReqd.html" rel="noreferrer">This example</a> shows a policy that grants <em>everyone</em> access to the objects in the specified bucket (i.e. making the website public):</p>
  
  <pre><code>{
    "Version":"2012-10-17",
    "Statement":[{
       "Sid":"PublicReadGetObject",
       "Effect":"Allow",
       "Principal": "*",
       "Action":["s3:GetObject"],
       "Resource":["arn:aws:s3:::example-bucket/*"]
    }]
  }
  </code></pre>
  
  <p>However, I want to make the website accessible to only specific Amazon users. So following <a href="http://docs.aws.amazon.com/AmazonS3/latest/dev/access-policy-language-overview.html" rel="noreferrer">this documentation</a>, I specify these users in <code>Principal</code>:</p>
  
  <pre><code>{
    "Version":"2012-10-17",
    "Statement":[{
       "Sid":"PublicReadGetObject",
       "Effect":"Allow",
       "Principal": {
          "AWS": "arn:aws:iam::Account-ID:user/Dave"
       },
       "Action":["s3:GetObject"],
       "Resource":["arn:aws:s3:::example-bucket/*"]
    }]
  }
  </code></pre>
  
  <p>While this correctly enables permissions for who can access the resource via the S3 console, it results in a 403 for <em>everybody</em> trying to access the hosted website.</p>
  
  <p><em>Is it possible to have user-level permissions restricting access to a hosted bucket?</em></p>