TerminalDilettante
TerminalDilettante

Reputation: 615

Is there a way to build AWS S3 bucket endpoints automatically, regardless of region?

So I have an app in Node that accesses stuff in buckets. I want it to be able to use buckets in any region, transparently. Unfortunately, the way of building the URL for the endpoint differs based on what region you're in.

If it's in US-Standard, I can say http://s3.amazonaws.com/BUCKETNAME/path/to/file. If it's anywhere else, that doesn't work (non-coincidentally, you're limited to domain-allowed characters (lowercase and numbers only) for bucket names in non-US Standard) and you use http://BUCKETNAME.s3.amazonaws.com/path/to/file.

(Note you can get more complicated and say

I'm thinking this is not a unique problem, so want to put it out there.

Upvotes: 0

Views: 215

Answers (1)

Michael - sqlbot
Michael - sqlbot

Reputation: 179084

http://bucketname.s3.amazonaws.com/path/to/file works in US-Standard also, so you should be able to use this single construct on any bucket anywhere (unless I'm missing something in your question).

Upvotes: 1

Related Questions