I'm configuring an environment with a Amazon S3 Bucket for storage of media files and Amazon CloudFront for restricted distribution purposes.
The access to those media files needs to be private and should be done via a signed URL. So I created the S3 Bucket on South America (São Paulo)
region and uploaded some test files. Then I created a CloudFront Distribution with that previous bucket as Origin
and it's Bucket Access
is restricted. I created a new OAI (Origin Access Identity) and also selected the option Yes, Update Bucket Policy
so that it auto-configures the S3 Bucket Policies
.
I'm only using the default Behavior
and it's configured with HTTP and HTTPS
viewer protocol policy and GET, HEAD
allowed methods. Restrict Viewer Access (Use Signed URLs or Signed Cookies)
is set and the Trusted Signer
is set to Self
.
Here's some images to clarify the setup:
I'm getting a HTTP 403
while trying to access the signed URL generated with either awscli or cfsign.pl
<Error>
<Code>AccessDenied</Code>
<Message>Access denied</Message>
</Error>
Is there something missing that I don't know? It looks like I made everything the docs said to do.