S3 Static Website Hosting when Bucketname is taken?
amazon-s3, amazon-web-services, dns, hosting
Solution
One way to solve your problem would be to store your website on S3 but serve it through CloudFront:
- You create a bucket on S3 with whatever name you like (no need to match the bucket's name to your domain name).
- You create a distribution on CloudFront.
- You add an origin to your distribution pointing to your bucket.
- You make the default behavior of your distribution to grab content from the origin created on the previous step.
- You change your distribution's settings to make it respond to your domain name, by adding a CNAME
- You create a hosted zone on Route 53 and create ALIAS entries pointing to your distribution.
That should work. By doing this, you have the added benefit of potentially improving performance for your end users.
Also note that CloudFront has been included in the Free Tier a couple months ago (http://aws.amazon.com/free).
Problem
I'm trying to host a simple static website from my AWS account with S3. I had an old dusty account with lots of strange settings from testing over the years, I also had an S3 account with a 'mypersonaldomain.com' and 'wwww.mypersonaldomain.com' bucket. Anyways I wanted to start fresh so I canceled the account to start new. Now when I go to create a 'mypersonaldomain.com' and 'www.mypersonaldomain.com' it says the bucket name is taken even though the account was deleted a while ago. I had assumed that amazon would release the bucketname back to the public. However when I deleted the account, I didn't explicitly delete the buckets beforehand. I'm under the impression to use S3 for static website hosting the bucket names need to match the domain name for the DNS to work. However If I can't create a bucket with the proper name is there anyway I can use S3 for static hosting? Its just a simple low traffic website that doesn't need to be in an EC2 instance. FYI I'm using Route 53 for my DNS. [note 'mypersonldomain.com' is not the actual domain name]