Connecting external domain name to AWS S3 website - amazon-web-services

I want to host a static website on Amazon S3. Created the relevant buckets - testing them ok.
Now I have a domain name i've registered with EuroDNS - www.gopropel.io - I can't find how to connect it to my AWS S3 bucket. Do I need to create a route 53 hosted zone? Went over the AWS documentation and they all assume you are registering your domain with them.

It is possible to route to host a static website without using S3.
Go to your S3 console and select your bucket.
Select the "Properties" tab, then select "Static web hosting".
Once this is setup you should see an endpoint url. Similar to this: "Endpoint :
http://xxxx.yyy.s3-website.xxxx.amazonaws.com"
Copy this url then create a CNAME record with EuroDNS and paste this link as the alias for "#" & "www" (optional). In the case of Eurodns set the host to your domain (gopropel.io & www.gopropel.io) and the canonical name as the url.
Allow a few minutes for the effect to go through and your domain should resolve to the s3 bucket.
This is not an ideal solution as it will limit certain features such as SSL (HTTPS).
The recommended approach is to go with Route53 it should cost less than $1.

Related

How to point a domain to Aws S3 static website

I have my domain registered and hosted at Hostpapa.
I have my web hosting in AWS S3. All set up as below:
Created a bucket in AWS S3 (named myDomain.org for example) with all the website content uploaded.
I'm able to access with URL like
http://myDOmain.org.s3-website.ca-central-1.amazonaws.com
The question is how do I point the domain in Hostpapa to AWS S3 website?
Thanks
The first thing to point out is that if you're trying to create a record for a root (or apex record) e.g. example.com you will need to ensure your domain service supports either ANAME or Alias records as traditionally only an A record (or AAAA for IPv6) will be supported for this record.
If your host supports one of these types (or is a subdomain e.g. subdomain.example.com in which case you can also use a CNAME record) you create the record and then use the CNAME provided as the value for your record.
If you are not able to configure in your current DNS provider, Route 53 does support Alias records so would be possible to add this for you.
It turns out straight forward.
In AWS S3
Create 2 buckets
myDomain.org
www.myDomain.org
Enable static web hosting in www bucket
Configure redirect for myDomain.org bucket to www
Upload website to www bucket
Copy www url (also called CNAME) like www.myDomain.org.s3-website.ca-central-1.amazonaws.com
In Hostpapa (or whatever the domain register)
Configure sub domain www to the above url (CNAME)
Wait couple of hours for propagation.
Works prefect!!!

Amazon S3 static website and Namecheap DNS

I am having trouble setting up DNS with Namecheap pointing to a static html website hosted in AWS S3.
Bucket config:
Currently, I get "chrisrich.io redirected you too many times."
This is the direct bucket url:
https://s3-ap-southeast-2.amazonaws.com/chrisrich.io/index.html
AWS S3 bucket name:
DNS settings in Namecheap:
What am I doing wrong?
There are two things:
The DNS record in Namecheap is for www.chrisrich.io and it's resolving to S3.
dig www.chrisrich.io +short
chrisrich.io.s3-ap-southeast-2.amazonaws.com.
s3-r-w.ap-southeast-2.amazonaws.com.
52.95.134.34
To make it work with www.chrisrich.io, you need to have the bucket name exact same name as www.chrisrich.io.
You can create a bucket with name www.chrisrich.io and put the files there , it should allow you to access your website using www.chrisrich.io.
You cannot have CNAME record for Apex domain chrisrich.io , it means you need to see if (URL forwarding) option available in Namecheap and chrisrich.io to www.chrisrich.io.
Also, Website endpoint doesn't support HTTPS, if you're planning to make your website work on https, you'll need cloudfront.
Also, to make S3 website endpoint work using www.chrisrich.io, you need to change your DNS record, currently you're using the REST API name for the CNAME record, chrisrich.io.s3.ap-southeast-2.amazonaws.com --> this should be the name of S3 website endpoint otherwise, index page won't load automatically and you will need to access it using www.chrisrich.io/index.html
You need to change your bucket name from chrisrich.io to www.chrisrich.io
Then, it will work.
Thanks

Routing domain hosted in third-party to AWS S3

I am trying to direct a URL request to an AWS S3 bucket.
So far I have done the following:
Create a bucket with the name app-name.app (domain is .app)
Make the bucket public and set property as a static website.
Website works fine when directly accessed through the S3 ARN.
Now I need to direct my (Godaddy) hosted domain name to this S3 bucket.
These are the steps I've taken:
Create a hosted zone in Route 53
Create record sets for A, NS and SOA types.
This is how it looks like:
After that I set the same NS server names in to Godaddy domain. I then also received an email from Godaddy stating that the nameservers have been changed.
However, I am not able to access the site through the domain name. It times out.
Appreciate some help figuring out what step I am missing.
Thank you.
1-Make sure your DNS changed correctly, by ping and trace.
2-Use DNS tools like mxtoolbox to check the records.
3-Add CNAME record with your S3 website public URL(It's different as S3 general URL), for example, add www.

Redirecting a custom subdomain to a static website hosted in AWS S3 bucket

I have a static website hosted in S3 inside the bucket client1.examplecorp.com with a corresponding R53 record client1.examplecorp.com. A ALIAS s3-website-us-east-1.amazonaws.com.
I want my client's (client1.com) webadmin to create a dns record for the subdomain quotes.client1.com which will point to AWS (The client1.com does not use R53).
Should it point to client1.examplecorp.com ?
Or directly at the S3 bucket endpoint ?
The concept is that, the final user will see only the quotes.client1.com subdomain and not know about client1.examplecorp.com .
I hope I describe it well enough...
I have read the AWS docs about Setting Up a Static Website Using a Custom Domain , Virtual Hosting of Buckets and also this SO post.
I have a feeling that what I am searching for is described here How to redirect domains using Amazon Web Services .
I just do not understand how the registrar of the client will redirect traffic for that specific subdomain (quotes.client1.com) to client1.examplecorp.com by adding the 4 nameservers.
Moreover, will the redirect affect only this subdomain or the whole client1.com .
Finally, will it be completely transparent? Meaning that, the client1.examplecorp.com will not be shown to the end user?
I have not a firm grasp on explaining it , so please bear with me.
Here are two possible solutions:
In these examples, the client's main domain is example.com.
Option 1:
Create a bucket whose name is the same as the desired hostname, and have the client create a CNAME record pointing to the web site endpoint for the bucket.
Bucket name:
quotes.example.com
Web site endpoint (assuming us-east-1 region):
quotes.example.com.s3-website-us-east-1.amazonaws.com.
Client DNS:
quotes.example.com. CNAME quotes.example.com.s3-website-us-east-1.example.com.
The client does not need to be using Route 53 for their DNS, but the bucket name must exactly match the hostname they are pointing to the bucket, because that is how S3 works.
Option 2:
Send the traffic through CloudFront. In this scenario, the bucket name does not matter, because CloudFront will translate it to the correct bucket name.
Bucket name:
example-bucket
Web site endpoint:
example-bucket.s3-website-us-east-1.amazonaws.com
New CloudFront Distribution system-assigned hostname:
djozxyqkexample.cloudfront.net
CloudFront Origin (do not select the bucket name from the dropdown list, type in the S3 website hostname as shown in the S3 console):
example-bucket.s3-website-us-east-1.amazonaws.com
CloudFront alternate domain name:
quotes.example.com
Client creates a DNS CNAME
quotes.example.com. CNAME djozxyqkexample.cloudfront.net.
This solution also does not require that the client use Route 53, and -- importantly -- the bucket name does not need to match the hostname -- the hostname simply needs to be configured as a CloudFront alternate domain name so that CloudFront recognizes the Host: header when it arrives.
If you want to reuse the same bucket for multiple sites, you can add more hostnames to the CloudFront alternate domain name setting, or you can create multiple distributions pointing to the same bucket.
Note also that using CloudFront in front of S3 is effectively free, because S3 will no longer bill you for bandwidth when you use CloudFront -- instead, CloudFront will bill you for bandwidth, at the CloudFront rate, which is often slightly lower that the S3 rate.
In both cases, above, the client does not need to use Route 53, because they hostname in question is not the zone apex hostname (the "naked domain"). To use a naked domain with either solution requires Route 53, but that isn't applicable here.
Unfortunately, I think this is not possible. I am assuming that you own the corporation domain in this case.
For you to use client1.corporation.com, you had to use Route 53, right?
You also could not configure some DNS record in your other NameServer and do the same.
Similarly, for you to use quotes.client1.com point to the S3 bucket, you also need to ask the client use Route 53.
Hope that helped
Cheers!

Amazon Route 53 Alias not working

For some reasons I am not able to set up my static website in S3.
I am trying to resolve this from last 2 weeks but its not working for me.
What I have done is:
Uploaded files within S3 bucket.
Set up routing policy - thats fine.
Alias target dropdown - I can see the S3 endpoints.
Created Hosted zones.
Set up both the alias with and without WWW.
Result - When I am typing URL in the address bar, it throws an error..either site is down or DNS related errors.
I tried implementing the same steps 6-7 times,No problems at all but domains are not working in the end. Absolutely clueless where I am going wrong?
Your hosted zone and domain name servers could be out of sync:
In Route 53, verify the Name Servers (NS) generated by your Hosted Zone match what's listed under your Registered Domains.
SCREENSHOT: AWS Route 53 Top Left Menu - Hosted vs Registered Domains
Click on "Hosted Zones"
Select your domain (example.com)
Select the "Record Set" with type NS
Copy each line item / name server from the value box
ns1.amazon.com
ns2.amazon.org
ns3.amazon.net
ns4.amazon.co.uk
Now click on "Registered Domains"
Select your domain
Past each entry in the upper right hand corner
SCREENSHOT: Paste example.com Name Server Entries
The major steps to create an Amazon Route 53 alias to an Amazon S3 bucket are:
Create a bucket with the DNS name (eg images.my-company.com) -- note that the Bucket Name must match the DNS that you wish users to enter when accessing the URL
Activate Static Website Hosting on the Amazon S3 Bucket
In Route 53, create a Hosted Zone or use an existing Hosted Zone
Create a Record Set in the Hosted Zone
Name: Match the subdomain to the name of your S3 Bucket
Type: A
Alias: Yes
Alias Target: Select your S3 website from the pull-down list
See: Setting Up a Static Website Using a Custom Domain
The most important part is that the Bucket must have the same name as the Route 53 domain name (eg images.my-company.com).
If problems are experienced, first try to access the content via the Static Website URL. If that works, resolve the URL (eg via DNSLOOKUP or PING) and compare the IP address to a resolution of your domain name. They should both return the same IP address.
I find a solution.
It seems I deleted my hosted zone which was created by amazon first time against my domain name.
Later when i created my hosted zone again against same domain name I am supposed to update nameservers in the hosted zone page which resolved the conflict of name server resolution
In my case it was a silly Error, I was using my earlier bookmark which was using HTTPS. As soon as I used HTTP, it worked. (ps: Prior to trying this I was routing via cloud front.)
As AWS documentation,
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/RoutingToS3Bucket.html
An S3 bucket that's configured as a website endpoint doesn't support
SSL/TLS, so you need to route traffic to the CloudFront distribution
and use the S3 bucket as the origin for the distribution.