Configure custom domain for Amazon S3 static website
In the previous article, I showed you how to create a static website hosted on an S3 Bucket.
If your domain registration is being managed at another provider, you will need to migrate its DNS service to Amazon Route 53:
In this article, I will guide you "How to point your domain name to the above static website".
1. Configuring Route 53
First, login to the Amazon Route 53 service:
Access the "Hosted zone".
Select a "Hosted zone" corresponding to the domain name you are interested in.
We will create a subdomain and point it to S3 Static Website. Click the "Create record" button.
Record name | Domain name or subdomain name. Such as:
|
Record type | The value of "Record type" in this case must be:
|
Alias | Yes |
Route traffic to | Select value:
|
Region | Select the geographic region where your S3 Bucket is located. |
S3 Endpoint |
|
Finally, click "Create Record". Normally, DNS changes need about 24 hours to be fully propagated to other DNS Servers, with Amazon 53 you may only need a few minutes to wait to feel the change.
2. HTTPS/SSL?
In the step above we configured Amazon Route 53 to point a custom domain name to an S3 Static Website. Everything seems perfect and you can access the website with your domain name using HTTP protocol.
- http://test.yourdomain.com
Basically, you can set up HTTPS/SSL for the above custom domain without using CloudFront, but it is quite complicated and is covered in the discussion below:
If you really need a static website with a custom domain name and HTTPS support, you should consider using CloudFront.
Amazon Web Services Tutorials
- Introduction to Amazon Web Services (AWS)
- Introduction to Amazon S3
- Introduction to Amazon Cloudfront and its architecture
- How to reduce Amazon Cloudfront Costs?
- Amazon CloudFront Invalidation
- Introduction to DigitalOcean Spaces
- Create DigitalOcean Spaces Bucket
- Introduction to Amazon ACM
- Java Awssdk S3 S3Client Upload object
- Create AWS accessKeyId/secretAccessKey
- Java Awssdk S3 List objects
- Host a static website on Amazon S3
- Java Awssdk CloudFront Invalidation
- DigitalOcean Spaces Create Access Key
- Java Awssdk Common Credentials Providers
- Java Awssdk ProfileCredentialsProvider
- Java Awssdk Creating and using EnvironmentVariableCredentialsProvider
- Java Awssdk Creating and using SystemPropertyCredentialsProvider
- Java Awssdk S3 Upload object with S3TransferManager
- Java Awssdk S3 S3TransferManager download object
- Java Manipulate DigitalOcean Spaces using S3TransferManager
- Java Create, list and delete S3 Bucket
- Aws Console create IAM User
- Create Amazon S3 Bucket
- Configure custom domain for Amazon S3 static website
- Create a CloudFront distribution for S3 Bucket
- Configure Amazon CloudFront Error Pages
- Amazon S3 Bucket policies
- Amazon AWS Policy Generator - policygen
- Migrate DNS service to Amazon Route 53
- Transfer domain registration to Amazon Route 53
- Request an SSL certificate from Amazon ACM
Show More