AWS Elastic Beanstalk suggests using a URL in the following format: https://{appname}.elasticbeanstalk.com/
But I need to change it to my own URL, something like https://tarta.ai
How to do it?
Note: I use Amazon Route53 for my domain.
I know this is old question but since I just done this process for one of my apps, I decided to share it here which may help others too. Here's the steps I've gone through
Login to your AWS Account
Go to your EC2 Panel and select your region
Select Load Balancer from left navigation menu
Found Load Balancer which related to your Beanstalk App
In Description Tab grab Hosted Zone ID
Open Route53 Panel
Select your domain hosted zone
Add A Record for .example.com
Select Alias option to Yes
Search for your Load Balancer related to you app
Confirm it's Hosted Zone ID with what you grabbed in step 5
Do steps 8-11 for www.example.com as well.
References
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customdomains.html
http://aws.typepad.com/aws/2011/05/moving-ahead-with-amazon-route-53.html
Use Amazon Route53. ELBs, including those generated with ElasticBeanstalk, are assigned CNAMEs. You can't just point your top-level domain at a CNAME, as it violates the RFC. You could point a CNAME record like http://www.example.com at it, but that still won't respond at http://example.com. It's an irritating problem; for example, consider this 7-page thread on the AWS forum.
The easiest solution is Route53. It uses special apex records to map TLDs to ELBs, thus avoiding the problem entirely. You can also use an EIP'd public instance to forward traffic to the ELB, although this raises scalability concerns.
Related
Per this earlier post, I was able to verify a domain of ours (which is in Route 53) to use as a custom domain with GCPs Cloud Run. However, we are struggling to update the DNS records for this domain now.
Our domain mydomain.com was previously used with an AWS EC2 instance. Our hosted zone in Route 53 for this domain currently has 8 records, of various record types (A, MX, NS, SOA, TXT, CNAME). Before uploading the 8 DNS records for cloud run (GCP gave us 4 A DNS records with ip addresses, and 4 AAAA DNS records with ip addresses, to upload), should I first delete all of the previous records in the hosted zone for this domain? I presume these earlier records are associated with our previous use of the domain with the ec2 instance.
Is it safe to delete all of the previous records from the hosted zone? Or maybe it is better to create a new hosted zone to use with GCP cloud run, and keep this initial hosted zone to remain with the EC2 instance? I am not sure if it is possible to have 2 hosted zones for 1 domain, or not. If only 1 zone is possible, I am not sure if i should delete + re-create a new hosted zone to use with Cloud Run, or try to edit my initial hosted zone (by deleting the old DNS records). I just need to move this custom domain from the EC2 instance to the cloud run app.
Thanks!
EDIT BEFORE BOUNTY: here are the DNS records that Cloud Run is telling me to add to my domain host (true values and domain name changed):
... and here is my Hosted Zone for the domain:
...the top 2 records are the new A and AAAA records that Cloud Run has given me (there was previously 2 A records that I deleted). When trying to create the A records, I actually received an error when I tried to create 4 separate A records, so I've put all 4 IP addresses into a single A record (not sure if this is correct).
Unfortunately, in the GCP /run/domains page, I am still receiving this error / warning message:
I do not plan to use the old AWS EC2 instance with this domain again, so perhaps I should delete all of the old DNS records that are associated with it? However I am not sure which records are safe to remove and which are not... Perhaps creating a new hosted zone is best (as suggested in an answer below)? Currently I am going the route of simply editing my old hosted zone (as was suggested in the comment below).
We have been struggling with this for most of the weekend and could really use some advice on getting this domain off of the EC2 instance and onto the cloud run deployment.
Edit2: I did just update the hosted zone with the cloud run DNS records a few minutes ago, so perhaps I just need to give it time? Again, I am not sure at all...
I will point out two most obvious ways and their pros/cons.
1. Safest way
You can create a new managed zone (GCP's equivalent to AWS hosted zones), create all the needed records for your cloud run app in GCP. Then change at your domain registrar DNS servers that you got from GCP (probably something like ns-cloud-a1.googledomains.com).
This way you will have full working copy (with setting to accomodate GCP's Cloud run) and in case you wanted to go back to AWS quickly you just need to point to AWS DNS servers at your domain registrar.
Cons of this solution are that you will have to pay a little bit more because you will be effectively hosting your domain at two providers (but only GCP will be actively used).
2. Easy way.
Create new managed zone at GCP, point your domain to GCP's DNS servers and delete hosted zone at AWS.
You can also backup your hosted zone in AWS - you can have a look at this blog post how to do it.
In my opinion if you ever plan to go back (or have a backup) of your domain records setup for AWS then first approach is the one to go for. Additional cost is also negligible.
UPDATE
Any changes made in DNS settings (adding & removing records, modyfying) requite usually up to 24 hours to propagate across the Internet.
Even more about DNS records and how to manage them.
If you want to add multiple A records to your managed zone edit your zone, click on "add record set" button, next select A record type (or AAA for IPv6 and type in the address first value, next click "add item" button below and type another etc.
If you prefer to do it using gcloud the here's some documentation how to add records to your zone (domain).
AWS young blood here. Our site is currently being hosted on a Google registered domain, specifically in a subdomain of our root "beta.{root domain}" It's time to switch the whole of the site to the root, and my understanding is that Google requires an A record to map that root domain, but I'm having problems.
We've previously been using a CNAME record to point the subdomain to an AWS Elastic Load Balancer without any problems. But when I try to use the ELB's A record in Google Domain's field I get an "invalid value error." Similarly, if I try to use an AWS Route 53 alias record in order to create an A record to our ELB, Google Domains won't accept that as valid entry either.
screenshot: https://i.imgur.com/L5CRWJD.png
I'm starting to think these two services are not going to play as well together as I had hoped.
Has anyone experience similar issues? What's the best way to try to resolve this problem? Should I look to transfer the DNS registration over to AWS / Route 53 and cut Google Domains out of the equation altogether? Or am I overthinking the issue?
Is there a way to configure the root of a Google Domain to point to an AWS Elastic Load Balancer simply and painlessly?
I'm new AWS and I have to continue maintaining previous developer service that is hosted on AWS. The ec2 instance that is hosted has map to domain name of https://****c.k**g.g***an.org.au, however I couldn't find this domain name anywhere. I tried looking at route53, but there's no such domain name registered.
Please help, how do I find the domain name that is mapped to the EC2 instance? Where can I get that information. The reason because I want to deploy a new instance but with the same domain name.
Edit: Masking DNS for privacy reasons.
Are you sure your DNS is hosted by Route53? Running dig against k***.g****.org.au has the SOA held by ns1.mooball.net.
The whois for mooball.net returns register.com as the owner, so I would consider reaching out to your internal teams to see who holds that account, then check your DNS delegation settings by logging in to register.com.
Often times the client will control their own DNS, so it would also be worth confirming with your client where their root DNS (garvan.org.au) is hosted - you can then trace the subdomain delegation to see where it is ultimately hosted.
check route53 service in AWS , since the domain is served by https..it could be the domain mapped to a load balancer and the load balancer has the instance...anyway you can know from the route53 there you find all the records
I have a hosted zone in Amazon Route 53 service and a domain name on a registrar.
In the registrar, my DNS configurations are correctly inserted, with the four address provided by AWS when I create the hosted zone.
In the Route 53 control panel, I have the NS and SOA proper configured as it came configured when I created the hosted zone.
I also created a A Redirection : mydomain.com.br -> xxx.xxx.xxx.xxx (elastic IP)
I'm able to reach my EC2 instance with the A Record: If I type mydomain.com.br on browser it works fine.
My problem is that I'm unable to reach the CNAME's that I've created.
I have a CNAME rule: www.mydomain.com.br -> mydomain.com.br/site but when I put www.mydomain.com.br I get a DNS error on my browser.
The strangest thing is that if I consult www.mydomain.com.br on a site like https://www.whatsmydns.net it points to www.mydomain.com.br/site, which is the correct redirect. The DNS resolution aparently works fine, but I can't get it on the browser.
Any help would be nice. Thanks.
ps: I alredy tried to ipconfig/flushdns and clear chrome's cache
Try this:
Delete that CNAME record
Add an A record in Route53
Name the A record 'www' it should automatically make that www.mydomain.com.br.
Check the ALIAS-yes box
Select mydomain.com.br. from the dropdown box (note there is a PERIOD on the end)
Save and Wait about 5 minutes.
A better (and still very cheap) way to do this might be to set up a 301 redirect in an Amazon S3 bucket. Here is a link to Amazon's tutorial:
http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html
Do you have a "www" A record which is pointed to your EIP?
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.