1

For example: example.com.s3-website-us-east-1.amazonaws.com?

Here is the value in the GUI

How can I get this value programmatically via the SDK? I can't seem to find it:

link to docs: http://docs.aws.amazon.com/sdkforruby/api/Aws/S3.html

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Stefan Lyew
  • 387
  • 2
  • 15
  • similar question: http://stackoverflow.com/questions/39466716/how-do-i-get-the-aws-s3-website-endpoint-url-through-the-api – Stefan Lyew Oct 20 '16 at 15:06

1 Answers1

2

The value doesn't appear to be exposed by the S3 API, itself.

It is, however, easily derived from the bucket location, which is accessible via the S3 REST API, though it isn't obvious from skimming the docs whether this is implemented in the Ruby SDK, either, in spite of its presence in the underlying API. I didn't find it.

But the web site endpoints are always in this form:

${bucket}.s3-website-${region}.amazonaws.com

In us-east-1, as shown in the screen shot, the endpoint for a bucket named example.com fits this pattern, example.com.s3-website-us-east-1.amazonaws.com.

http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

Michael - sqlbot
  • 169,571
  • 25
  • 353
  • 427