2 Answers
- Newest
- Most votes
- Most comments
1
Hi, I would use
aws s3api get-bucket-location --bucket <BUCKET_NAME> --output text ====> <REGION>
and then use the <REGION> info to build the website string, which is pretty standard:
http://<BUCKET_NAME>.s3-website.<REGION>.amazonaws.com
Hope it helps ;)
aws cli should give the full url, just saying
I agree with you. It is unfortunate that it doesn’t support that
0
The existing answer is good but there is an (ugly but workable) alternative:
aws s3 presign s3://BUCKETNAME/a | awk '{split($1,a,"/"); print a[3]}'
Note that this doesn't make a call on the network - it's a completely local operation.
Relevant content
- asked 21 days ago
- Accepted Answerasked 2 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 2 months ago
Have you enabled Static website hosting for S3 bucket? Can you also paste output of command you are running?
Normally , Depending on your Region, your Amazon S3 website endpoint follows one of these two formats.
-- s3-website dash (-) Region ‐ http://bucket-name.s3-website-Region.amazonaws.com
-- s3-website dot (.) Region ‐ http://bucket-name.s3-website.Region.amazonaws.com