Routing domain hosted in third-party to AWS S3 - amazon-web-services

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.

Related

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

Alias Record not working in Route53

Been through a couple of tutorials, AWS official docs and SO questions, and still can't get my Route53 Alias to work.
I've done this in the past, but for some reason on this particular domain – www.tallyhaus.com, the same steps I've taken before just don't seem to work.
I'm 100% sure of the following:
bucket name matches the alias record name
my bucket is reachable: the s3 endpoint offered by the bucket works, and is hittable
the NS entries are the same on my registered domain, as in my NS record on my hosted zone
The domain in question is www.tally.haus.
The only different thing I can think of is that I have a subdomain for my API, which lives under api.tally.haus, and that NS record points to the NSs on my Lightsail instance – but I created a separate hosted zone for that subdomain.
I even tried creating a CloudFront distribution to see if that works, and still nothing.
Ideas?
Thanks
NOTE: Endpoint that I'm talking about, the one that isn't resolving, is www.tally.haus.
Step-by-step example
Create a bucket with the name mysite.tally.haus
Activate static website hosting on the bucket. Website endpoint will be
similar to this: http://mysite.s3-website-us-west-2.amazonaws.com
Add index.html to the bucket
Make the index.html public
In Route53 add an A-Record, click on Alias and type in appropriate S3 Website endpoint depending on your S3 bucket location.
For this use case, it is : s3-website-us-west-2.amazonaws.com.
Record set will look like this:
mysite.tally.haus. A ALIAS s3-website-us-west-2.amazonaws.com.
Amazon Simple Storage Service Website Endpoints:
https://docs.aws.amazon.com/general/latest/gr/rande.html

AWS Route 53 setting www prefix

I want to host a site on Amazon S3 servers (and use Route53 as a DNS).
I followed the tutorial from AWS page: https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html.
Say, that my website is ex.ample.pl. I want it to be reachable from ex.ample.pl and www.ex.ample.pl.
What I did:
in S3 created bucket for ex.ample.pl,
in S3 created bucket for www.ex.ample.pl and redirected it to ex.ample.pl,
in Route53 created hosted zones for ex.ample.pl and www.ex.ample.pl,
for domain registrar I gave NS records for ex.ample.pl,
in Route53 in zone www.ex.ample.pl settings are like in
this picture . NS are not like in ex.ample.pl
As an effect, I can access the site at ex.ample.pl, but I can't at www.ex.ample.pl. Bucket redirection works for sure, there must be some error in DNS setup. Do you know what may cause this problem?

Static website on S3 with route 53 - Site can't be reached

I have hosted a static website on S3 with suitable bucket policy set. Viewing the "endpoint" in another tab works perfectly fine. After this I created a Hosted zone in route 53 to give it a desirable human readable address.
After creating the hosted zone, I have two records in my newly created hosted zone, One being of type NS and the other being of type SOA. So far so good. I go ahead to create a new record set.
I add the name as desired, enter type as 'A' - IPv4 Address tick yes for Alias, where in the drop down (Alias Target) i can see my previously created bucket endpoint.
I set the routing policy to be simple and Evaluate Health Target set to no. The record set is created successfully. However when i enter this name in another tab, I get the "Site can't be reached". I try and test the record set using the functionality provided by AWS. Here the response code i get is "NOERROR" which i assume is a positive response. Am I missing something here.
I have also referred to this video. Am I missing something. Also, I have not created the Hosted Zones myself.
A hosted zone is not the same as domain. You have to update the NS values for your domain registrar to point to the NS values as generated by Route53.
From the docs:
When you create a hosted zone, Amazon Route 53 automatically creates a
name server (NS) record and a start of authority (SOA) record for
the zone. The NS record identifies the four name servers that you give
to your registrar or your DNS service so that DNS queries are routed
to Amazon Route 53 name servers.
[...]
After you update the settings with your domain registrar to include
the Amazon Route 53 name servers, Amazon Route 53 responds to DNS
queries for the hosted zone even if you don't have a functioning
website.
NS transfer may take from 1 to 24 hours, depending on the registrar.
I faced the same issue. I bought domain thevegfoodies.com through AWS Route 53, created simple index.html page and uploaded to bucket thevegfoodies.com and set bucket for Static website hosting ,added public policy. created second bucket www.thevegfoodies.com and redirect to thevegfoodies.com, created aliases everything , read through documents everything. But nothing worked.
Until, i realized that my redirect bucket www.thevegfoodies.com was not set for public read access. I set it too Read bucket permissions for Everyone. (Note my primary bucket thevegfoodies.com already has public access.) and i could load my website using my domain name.
Now, I have read through AWS document again just to see if I missed this step of setting up public access for redirection bucket.
https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html and all other steps to setup static website.
if you check Step 2.3: Configure Your Website Redirect, it is not mention that we need to set public access.
POINT- AWS Documentation is not clear. One need to have public access to redirect bucket too.

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!