Search code examples
amazon-s3amazon-cloudfront

Cloudfront giving temporary access denied


I have this scenario:

  1. User initiates a process
  2. Server constructs and uploads a file to S3
  3. User attempts to access file through Cloudfront

    #2 and #3 are asynchronous, so it's possible that the user can attempt to access the file before it is uploaded to S3.

    When I try to access the file on cloudfront, I get an Access Denied error. However, I can verify that the file exists on S3, and is accessible.

If I wait a minute or two, this access denied error is gone, and I can access my file through cloudfront. What's going on?


Solution

  • Eventual Consistency seems to be my problem.

    All cloudfront distributions have it. The S3 Virginia region also has it.