Pointing sub domain only to AWS EC2 instance? - amazon-web-services

I am trying to migrate a PHP site to AWS.
I have created an instance with a specific AWS url and have configured an AWS Route 53 service.
Looking at the docs here: http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html#root-domain-walkthrough-update-ns-record
It says to update the Nameservers for the particular domain, however that would affect the live version of the site which is still being hosted on Digital Ocean.
What I want to do is:
Point a subdomain e.g. dev.mysite.com to the dev environment on AWS
Check everything is ok
Create a live environment on AWS
Point mysite.com to the live environment.
I am still new to this way of hosting, is what I am trying to achieve, feasible.
Or is there another way I should be tackling this.
Any suggestions welcome.
Thanks

That's absolutely fine. Within Route 53, you can create an a record for your Apex (www.site.com) to point to your EC2 (?) instance, and then another CNAME record which points to your dev.site.com
Note that Alias records are free, and the preferred way of doing the above, but only work with certain types of AWS resources such as ELBs.

Related

Keeping Registrar's DNS Service but pointing to AWS Resources?

I have been struggling with this, I dont fully understand the concepts of DNS. But, all the articles I have come across details how to migrate from existing DNS Service to Route 53 DNS Service, which I have heard is not free. I just want a domain hosted at porkbun to point an Amplify app. How do I do it?
So, you want to connect your Porkbun domain to a third-party site(yourapp.amplifyapp.com), but AWS don't provide an IP address—but they do provide a (yourapp.amplifyapp.com).
No problem! You can do it: via CNAME flattening (aka ALIAS records).

Cannot route traffic to AWS Elastic Beanstalk environment using Route 53 and custom domain under the same account of AWS

I have been trying to host our php website using Elastic Beanstalk however I had no luck under Hosted Zones. Domain is registered with the same AWS account.
Things I did:
Created a hosted zone named mycustomdomain.com
Created a A type record set with ALIAS to my environment. (Selected through drop down of AWS itself.)
The domain name of EB Environment
environmentname.randomclashofcharacters.region.elasticbeanstalk.com
assigned by AWS works flawlessly so I can say that there is nothing wrong with the config at Elastic Beanstalk side of things.
I followed through the guide uploaded by AWS themselves
I see one weird thing that might be causing that. The name servers listed under domain name is different from ones listed in Hosted Zone. Should I change them. AWS guide doesn't says to do so, so I didn't do it.
Thanks for your help beforehand.
Cheers,
~bio
Thanks to corrective help from #heplalump the problem is resolved. I actually needed to make domain's name-servers same with the hosted zones. Still cannot reach from desktop Safari but reachable via chrome and iPhone safari. If you want to do this procedure for yourself just follow the guide amazon provided.

Domain name not connecting to node.js express web app

I have an issue, or perhaps an understanding problem with linking my domain with AWS. I will use the xy.ro domain as an example.
I have the xy.ro domain registered with easyhost.com. On AWS I have a node.js express web app.
My xy.ro domain is not working as it does not point to anything.
I tried to create a hosted zone on AWS with the xy.ro domain and tried to create a dataset for this domain but it does not work.
I tried to find step by step instructions also on AWS and other providers but I did not find anything.
Can someone point me into the right direction?
If your domain xy.ro is registered with easyhost.com then it would presumably also be using their DNS hosting service to serve your DNS records.
Creating a public hosted zone in AWS won't affect the DNS resolution unless you can migrate your name servers to use Route 53.
I was not able to see steps from easyhost.com website, however from the AWS side take a look at this documentation.
You should be able to copy the name servers and update within easyhost so that it will use Route 53 as your DNS provider instead.

Issues using Google Domains and AWS

So, this is my first time setting up a simple website and I decided to purchase a domain on Google Domains and I plan on hosting it on the AWS Free Tier plan. The domain was purchased last week. So, I am cannot transfer because the domain name is within 60 days of initial registration.
The goal is to create a simple landing page which uses a PHP script to generate a simple mailing list.
I have read this link 2-3 times already and followed all the steps:
https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html
I want to keep all my G Suite features but I cannot because the guide asks me to copy AWS nameservers in my hosted zone to the DNS settings on Google Domains. This results in this.
I want to stick to AWS and not move to another hosting service, for certain reasons. Please guide me in the right direction. Thank you.
So I was able to fix this after I studied a bit and posted it on Reddit and got the answer.
Because we are working with subdomains, I made an S3 bucket with the subdomain name. I made the files public and generated the standard policy. Took the S3 bucket endpoint, and then went back to Google Domain's DNS settings.
I didn't need Route 53 in the first place. All I did was create a CNAME record with the subdomain and set TTL to 1 minute and the S3 endpoint as the data. And BOOM! It worked.
I believe when I move on to create more dynamic websites, I have to expand my search and learn more.
Thank you for everyone's help.
You can keep using Google Nameservers, along with hosting your website on you AWS Server (whatever the service you are using, like EC2, beanstalk).
Suppose if you are using an EC2 instance to host your server, make a note of its Public IP (I'd recommend using elastic IP). Now go to your google domain record set and create an A record with the IP of your EC2 instance.
refer https://support.google.com/a/answer/2579934?hl=en for details.
Using route53 is optional. It just helps you to store resource records. If you can create them somewhere else, Route53 is not required.

How to set up custom domain for an app on Amazon EC2?

I am new in the Amazon EC2 world, I just created an app, that is located URL like this:
http://ec2-54-123-45-678.compute-1.amazonaws.com:8080
This is generated URL by Amazon EC2.
Now I would need to use my own domain name, so when I would access www.my-domain-name.com, I would like to see the content from
http://ec2-54-123-45-678.compute-1.amazonaws.com:8080
I bought the domain name on Godaddy.
Is there any way to do this in Amazon AWS dashboard or do I need to set it up in Godaddy system?
Thanks
I am answering on a more general level because I stumbled upon this thread when setting my custom domain.
In Amazon I created an instance and associated an IP to that instance. You were able to access it by typing in the amazon url
I actually used Media Temple not GoDaddy, but it will be similar. I went to the zone file and added that public url to the www
And as you can see, here is my blog actually working on the custom domain.
I set the wildcard because that way, no matter what someone types, if it is not set, then they will still see the site.
EDIT
For the root URL you should be entering your elastic IP and setting that as an A record.
First you need to set an ElasticIP for associated to that instance.
Then point the DNS entry of "www" for "my-domain-name.com" to the IP assigned in the step above.
Where you manage your DNS is another thing, can be in GoDaddy or in AWS Route53. You must adjust the delegation DNS in the "my-domain-name.com" register. Ex: your domain can be registered with GoDaddy but its delegation DNS point to Route53 so you can manage the domain from your AWS Console.
In order to setup DNS mapping you can map the existing IP 54.123.45.678 to ex: www.my-domain-name.com.
However, as you are running tomcat which is running at 8080 you need to forward the the request to the tomcat using Apache. So that you can visit www.my-domain-name.com without port 8080. If you are using linux box install Apache, apache-modjk and then configure sites.