1

I'm attempting to use an S3 bucket to host media files (images, video and static files) for a small web application and came across a strange catch-22...

According to the S3 documentation, to serve a static website (it's not a static website, just static files), the bucket name must be the same as the domain/subdomain that the files are being served from, so that Route53 lists it as an ALIAS option under S3 buckets. I did this, named the bucket media.domain.com and added the record to Route53 as an A record for media.domain.com.

However, when using S3FS to mount this S3 bucket to the file system of my EC2 instance, the mount failed because of the dots in the bucket name: https://github.com/s3fs-fuse/s3fs-fuse/issues/602

I need to mount this bucket to the EC2 instance because we need to accept file uploads via a NodeJS microservice and set the storage destination to a location the S3 bucket with full read/write permissions, hence the need to mount the S3 bucket so the microservice on the EC2 instance can write to the S3 bucket.

The catch-22: To serve these static files from S3 using Route53, the name must be the same as the A record. To mount a bucket, there cannot be dots in the filename - A records have dots...

My question is if someone has a solution, or can see the big picture and tell me if I'm going about this in the entirely wrong manner. I'm fairly new to AWS.

We're using S3 and not CloudFlare because of cost, we need the less expensive solution for now.

Thanks!

3
  • 2
    Personal suggestion: Do not use s3fs. It is in no way supported or developed by AWS, and we ran into problems over and over again. It has a bucket full of unfixed issues, no real development model, and no bug fixes ever.
    – M. Glatki
    Jul 2, 2018 at 12:01
  • 1
    Why can't you use aws cli and an IAM role to upload to the bucket?
    – strongjz
    Jul 2, 2018 at 16:47
  • Because we process and optimize incoming files, not possible with S3
    – mwieczorek
    Jul 2, 2018 at 18:44

1 Answer 1

1

You can try the workaround in the FAQ: https://github.com/s3fs-fuse/s3fs-fuse/wiki/FAQ#q-https-connecting-failed-if-bucket-name-includes-dot- or use other tools like goofys which doesn't have this limitation

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .