vendredi 3 avril 2015

Possible to allow client upload to S3 over https AND have a CNAME alias for the bucket?

OK, so I have a an Amazon S3 bucket to which I want to allow users to upload files directly from the client over https.


In order to do this it became apparent that I would have to change the bucket name from a format using periods to a format using dashes. So :


my.bucket.com


became :


my-bucket-com


This being required due to a limitation of https authentication which can't deal with periods in the bucket name when resolving the S3 endpoint.


So everything is peachy, except now I'd like to allow access to those files while hiding the fact that they are being stored on Amazon S3.


The obvious choice seems to be to use Route 53 zone configuration records to add a CNAME record to point my url at the bucket, given that I already have the 'bucket.com' domain :


my.bucket.com > CNAME > my-bucket-com.s3.amazonaws.com


However, I now seem to have hit another limitation, in that Amazon seem to insist that the name of the CNAME record must match the bucket name exactly so the above example will not work.


My temporary solution is to use a reverse proxy on an EC2 instance while traffic volumes are low. But this is not a good or long term solution as it means that all S3 access is being funneled through the proxy server causing extra server load, and data transfer charges. Not to mention the solution really isn't scalable when traffic volumes start to increase.


So is it possible to achieve both of my goals above or are they mutually exclusive?


If I want to be able to upload directly from clients over https, I can't then hide the S3 url from end users accessing that content and vice versa?





Aucun commentaire:

Enregistrer un commentaire