Search code examples
amazon-web-servicesamazon-s3aws-cli

How do you get the Bucket website endpoint for an S3 bucket setup for static hosting?


How do you get the generated Bucket website endpoint for an S3 bucket using the AWS CLI?

The closest thing I can find is get-bucket-website, but it doesn't return the Bucket website endpoint.


Solution

  • Website endpoint format is standard and documented: S3 Website Endpoints.

    From the official doc regarding the endpoint format:

    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