开发者

Finding Out if an Amazon S3 Bucket is a Website in Ruby

Amazon recently allowed S3 buckets to be enabled as websit开发者_运维知识库es. Using the aws-s3 gem or something similar, is there a way to programmatically determine whether a given bucket is enabled as a website or not?

Edit: In addition, if a bucket is indeed a website, how would you obtain the endpoint url?


You can use the REST api to access, and set that option

http://docs.amazonwebservices.com/AmazonS3/latest/API/index.html?RESTBucketPUTwebsite.html

in your case use "GET Bucket website"

Extra points:

The endpoint would be just the bucket URL : example-bucket.s3.amazon.com

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜