Domain DNS: move from AWS to Heroku - amazon-web-services

I had a static page on aws with a custom-domain.com and everything worked fine. Then, I wanted to use that domain for another site deployed on Heroku. I neeeded to unbound the domain from aws, intuitively I just deleted the buckets from the aws console. Now I have:
404 Not Found
Code: NoSuchBucket
Message: The specified bucket does not exist
I contacted domain provider company. In their answer I identified, that the domain name uses aws DNSs, but not heroku. They also added that all the changes should be made in aws, unfortunately I do not have the buckets to work with.
What should I try to do next? I can buy another domain (it is not sufficient), but it will mean that I am defeated. I want to win, will you help me to conquer the "web bug"?

When Setting Up a Static Website Using a Custom Domain, the following configurations are made:
A bucket is created with a name name matching the domain (eg custom-domain.com)
Static Website Hosting is activated on the bucket, which provides a DNS name (eg customer-domain.s3.amazonaws.com)
A DNS entry is made in Route 53 or another DNS service that is a CNAME record pointing to the DNS name of the static website
Since your configuration was working, we can assume that all the above configurations had been made. Then, when you deleted the bucket, the domain name kept pointing to S3. With no bucket to display, S3 gave you the NoSuchBucket error.
If your intention is to point custom-domain.com to a different service (eg Heroku), you will need to modify the DNS entry for that domain name:
If your domain name is hosted by Route 53, go the the Route 53 management console, find the domain and enter a new CNAME or IP address
If your domain name is hosted elsewhere (eg GoDaddy), go to their control panel and enter a new CNAME or IP address
Bottom line: You want to change the DNS entry.

Related

Route 53 Alias record not pointing to S3 static hosted website

I have bought a domain sandesh.link from route 53, created a publicly accessible S3 bucket with the same name, created a hosted zone and created an alias record pointing to the S3 static hosted website.
When accessing the domain, it shows that the domain is still parked at gandi.
I have updated the nameservers of the domain to the ones given in the hosted zone nameservers(can be seen at whois). I've also verified the domain through email.
How can I get this working?
Based on the comments.
The domain provided, when tested worked fine. It correctly showed:
Welcome folks Welcome
The reason it did not work before, could be that DNS changes were not fully propagated.

Change CNAME mapping from Root Domain to WWW on AWS s3?

I'm getting 400 Bad Request and "The specified bucket exists in another region. Please direct requests to the specified endpoint." when going to my domain: http://www.*.com/. I have the CNAME record on namecheap set to: .com.s3-website.us-east-2.amazonaws.com, which works fine when I type it in the browser. It seems like it's going to www..com.s3-website.us-east-2.amazonaws.com instead, (with the www added), because you get the same error if you type that into the address bar. I spoke with namecheap support, and he told me to change the CNAME host to # and delete the url redirect record because "it might be that the configuration of your website requires bare domain name not WWW". That didn't work. I also have namecheaps private email and he mentioned "your Email Service won't work if you have CNAME for the Root Domain". He told me to contact AWS support (I dont have tech support plan) and tell them to "Please contact your Hosting provider to change records from their side from Root Domain to www" and "you should change CNAME mapping from Root Domain to the WWW."
So I'm stumped here. Can anyone help me here? Is there a way to do what he said and will it fix my problem? Thanks.
This error means that you have configured the CNAME record in your DNS server to use the wrong S3 static web site endpoint.
Your CNAME is using us-east-2. In what region is the bucket located?
Go to the Amazon Console.
In S3 bucket properties, click on static web site hosting.
Copy the URL for your web site.
Go to your DNS Server.
Go to the record for www.
Make sure that the CNAME matches the static web site URL.
[EDIT after a series of comments]
If you create a bucket with the name www.hibachiandyou.com then the domain must exactly match the S3 bucket name. If you want to also have a the domain hibachiandyou.com, then you need another bucket with the exact same name. You cannot use DNS redirects to get from one to the other. Use any other convention and it will not work.
The domain apex (hibachiandyou.com) cannot be a CNAME. Amazon Route 53 supports using ALIAS records for the domain apex. I am not aware of any other DNS server that supports ALIAS records. Recommendation, move your DNS servers to Route 53.
You can use a redirect with S3 to redirect one static web site to another web site. Review section 2.3 in this link.
Setting up a Static Website Using a Custom Domain

Domain name setup with AWS S3 bucket with static hosting

Im trying to link my domain name to a static website on aws S3
I have 2 buckets set up on S3 one is domain.com and the other is www.domain.com. doamin.com has static website hosting enabled
www.domain.com redirects to the domain.com
I can access my index page through: https://s3.us-east-2.amazonaws.com/domain.com/index.html
but it doesn't work with this url and I get an access denied message: https://s3.us-east-2.amazonaws.com/domain.com
I have 2 host records both are CNAME:
Host: #
Value: www.domain.com.s3-website-us-east-2.amazonaws.com
Host:www
Value: domain.com.s3-website-us-east-2.amazonaws.com.
In my browser it says "site can't be reached" when I have either of those cname values as my url. Also my domain is registered with NameCheap and I can't transfer it to route 53 as it is not old enough. I've never done this before so I really don't understand what I'm doing wrong.
You don't need to transfer the domain to AWS. All you need to do is create a hosted zone in AWS route 53. What you're going to do is set up a new DNS configuration inside AWS and then tell your registrar (NameCheap) to use the AWS nameservers.
Create the hosted zone with your domain name, domain.com
Create an A record for your domain. On the right side you'll see a radio button "Alias" choose yes, then click into the target box and wait for your bucket to appear under S3 Website endpoints. (More on this below).
Select your bucket and click create.
Head over to your registrar, NameCheap and configure the nameservers to use the AWS nameservers in the NS record from your AWS hosted zone.
In order for this to work you need to make sure your S3 bucket is named and configured correctly.
Your bucket name must match the domain name.
In the properties tab, you need to enable the static website hosting option and provide your index page.
In the permissions tab, click on bucket policy, then click the policy generator link at the bottom.
In the policy generator, select S3 as the type of policy
Set the principal to *
set the action to Get Object
set the ARN to the ARN for your bucket /*. For example arn:aws:s3:::domain.com/ *
Click Add statement, then generate policy and paste that into the bucket policy and save.
Finally upload your assets and you're done
Also my domain is registered with NameCheap and I can't transfer it to route 53 as it is not old enough.
You don't have to transfer it... the registration is locked, but the name server settings should not be... so you can use namecheap as registrar and still use Route 53 as authoritative DNS. And that is what you need to do. (You can transfer the registration to the Route 53 Registrar later, or never. Route 53 provides the two services, registrar and hosting, separately.)
Configure a new hosted zone in Route 53, configure it appropriately, and then change the authoritative nameservers at Namecheap to use the 4 nameservers that Route 53 assigned to your hosted zone.
It isn't possible to use S3 at the root (apex) of a domain that isn't hosted in a Route 53 hosted zone, because a CNAME at # is simply not a valid configuration. Some people will argue to the contrary, and some DNS providers even allow it, but it is still an entirely invalid configuration. This is why Route 53 introduced Alias A records. They are valid at the apex of a domain, and solve this issue.
Needed to have basicDNS on NameCheap and use www.domain.com as my main bucket and have domain.com redirect to the main bucket

Redirecting route53 purchased domain to s3 bucket?

I've just purchased a domain from Route 53 and created corresponding buckets in AWS s3. I've followed the instructions from: Example: Setting Up a Static Website Using a Custom Domain.
Let's say my custom domain is called customdomain.com.
I've created customdomain.com and www.customdomain.com buckets in s3 and allowed static website hosting on customdomain.com and enabled redirecting from www.customdomain.com to the customdomain.com bucket.
When I enter the endpoint for customdomain.com it works just fine, meaning my bucket policies are working correctly.
Next, in Route 53, I've set up Hosted Zone for customdomain.com.
I've also created a record set in that hosted zone with the name:
customdomain.com, type A, aliasing to customdomain.com's endpoint (which I chose from the dropdown menu). I left everything else as default then saved it. I added the record for www.customdomain.com but had it alias to customdomain.com
When I try to access customdomain.com, Chrome states that the site can't be reached.
Did I miss a step somewhere or does it take time for my site to be up due to DNS propagation or something?
Fixed it.
Apparently, the domain's name servers weren't the same as my hosted zone's name servers

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.