abbood
abbood

Reputation: 23558

S3 bucket name with dots returns "must be addressed using the specified endpoint"

I've been using node s3-cli library for a while to upload files into my S3 buckets. This worked for example:

s3-cli sync --delete-removed dist s3://domain-admin-dev

But when I run this

s3-cli sync --delete-removed dist s3://sudomain.domain.com

it returns this error:

Error: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

What should I do?

Note: I found some posts on the web talking about the S3 bucket not belonging to the right region, however the s3://sudomain.domain.com belongs to the same region as the s3://domain-admin-dev one. So it doesn't make sense for that to be the problem.

Upvotes: 0

Views: 1369

Answers (1)

abbood
abbood

Reputation: 23558

It turns out that this whole approach was wrong. I simply had to add a cloud front distribution (ie a CDN) and then link it's origin to the s3 bucket (the name of which I changed back from s3://sudomain.domain.com to s3://domain-admin-dev, thus making my cli command work just fine). I then created a CNAME record in my godaddy pointing the subdomain to the cloud front Origin.

The process is depicted here:

enter image description here

note: since cloud front is a cdn, the cache must be invalidated everytime it's updated.

Upvotes: 3

Related Questions