add godaddy domain to AWS Elastic Beanstalk site? - amazon-web-services

I have a working web app hosted on Elastic Beanstalk and have purchased a domain name on godaddy.
I've got it set up so when you visit the domain it takes you to the correct page but the URL changes to the ugly elastic beanstalk address.
At the moment when I visit the domain name URL, the URL changes to
uglyurl.5345435trgfdg.elasticbeanstalk.com/CORRECT/ROUTES
I want it like
mydomain.com/CORRECT/ROUTES

You need to configure whatever software you are running on Elastic Beanstalk (Apache or Nginx probably) to be aware of the domain name. The server software is simply redirecting all requests to the only domain it knows it is hosting.

Related

Linking GoDaddy with Elastic BeanStalk

So I just bought a domain with godaddy www.abc.com (example)
I have then uploaded my flask back end and successfully deployed it to elastic beanstalk.
The elastic beanstalk has given a url as elastic-region.com.
However this url is HTTP, therefore
I have then created a certificate for www.abc.com
Now the problem is I cannot link my godaddy to my elastic bean server.
I have set up the CNAME where Name = www and Value = elastic-region.com.
As well as the certificate as name = xyz value = yzx
After all the configuration I still am not able to connect it to the elastic bean. When I enter the url www.abc.com it redirects be back to godaddy account page
I would suggest moving your DNS to route53 DNS service. You can do this by adding a hosted zone in route53 and changing your name servers in GoDaddy. In Route53 you can directly alias towards your elastic beanstalk environment on A / AAAA records.
If you want to continue hosting your DNS at GoDaddy; I would suggest using tools like https://mxtoolbox.com/ to verify if your DNS is set correctly. The method you described in your post would be sufficient to CNAME towards your EB environment.
AWS resource to create an alias towards Elastic beanstalk:
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-beanstalk-environment.html#routing-to-beanstalk-environment-create-alias-procedure
Some resources to help you change nameservers:
https://www.godaddy.com/help/change-nameservers-for-my-domains-664
https://virtualizationreview.com/articles/2020/07/14/migrating-dns-services-aws.aspx
you can also move your whole domain to AWS;
https://blog.shikisoft.com/transferring-domain-registrations-from-godaddy-to-amazon-route-53/

AWS elastic beanstalk, apis, and subdomains. How do I set my backend api to be a subdomain of my front end url and secure it?

I have a url that points to a s3 hosted angular application. at example.com
That works fine and its running under https
now I want to take my django powered API and running on elastic beanstalk and make it work as a subdomain called api of my example.com website.
So to get to the backend they type api.example.com
the domain is registerd with godaddy.
There I have CNAMES for www.example.com and example.com
now for the subdomain I can't do a A record because I don't have the IP address of the elastic beanstalk instance.
Cant do the CNAME way as it was giving me an error. When I put the elasticbeanstalk url in the points to field
http://example-env.eba-thingy.somereigion.elasticbeanstalk.com
I get an error that says: Enter either # or a valid host name such as: "subdomain.domain.tld"
CNAMES A Names Subdomains its all so foreign. What do I need to do to handle this correctly?
I also tried the subdomains form with no success

how to access elastic beanstalk app after linking it to godaddy domain?

I have created a spring boot application and deployed it to AWS elastic beanstalk. I could easily access it with the environment URL provided by AWS. Then I implemented SSL in my app. I tested it locally and it was responding on https request but not on http request. Then I got a domain from godaddy and I linked it to my AWS elastic beanstalk app by following AWS route 53 documentation carefully. How can I access my spring boot app now? None of these CNAME, Alias or any other record set URL is working
These are the record sets I have created and linked to my elastic beanstalk app
You should only need an "A" record type here that directs www..com to your EB url and then one name server "NS" record where you'll enter the detail retrieved from your GoDaddy account in "My Domains" > "Select Domain" > "Domain Settings".
One record for NS and the "value" portion will be the 4 name servers you found in GoDaddy.

AWS Route 53 aliased A record is causing 301

I have an Elastic Beanstalk application that I'm attempting to route a custom domain name to using a Route 53 hosted zone, i.e., mycustomdomain.com should route to fooelbapp.us-east-2.elasticbeanstalk.com. Within the Route 53 hosted zone, I've created an A Record with mycustomdomain.com as the name and a value of ALIAS fooelbapp.us-east-2.elasticbeanstalk.com. Now when I attempt to navigate to mycustomdomain.com, I receive a redirect to fooelbapp.us-east-2.elasticbeanstalk.com, which is not the expected behavior. The expected behavior is a 200 response and the page to load under the custom domain name, not the Elastic Beanstalk CNAME URL. Has anyone else experienced this issue?
The Elastic Beanstalk application is a WordPress 4.8.2 site on PHP 7.
Solution
#Mark B is correct, the issue was caused by my Site Address and WordPress Address being set to the Elastic Beanstalk CNAME URL, after correcting this everything works as expected and my custom domain name now resolves to the Elastic Beanstalk application without 301 redirecting.
Route53 does not issue HTTP redirects. What is happening is your application server thinks it is serving the domain fooelbapp.us-east-2.elasticbeanstalk.com, probably because that's the domain it finds when it starts up. So any requests it receives that aren't for that domain it is redirecting.
You need to configure your application to be aware of the actual domain name you want it to serve. How you would do that will depend on what web server you are using. If you need more help please provide more details about your environment.

New domain on aws elastic beanstalk

I have a nodejs app running on elastic beanstalk. I have a domain registered through GoDaddy and a cname that points to myapp.elasticbeanstalk.com.
1) Can I point my domain to aws nameservers, instead of mapping that domain to the domain that eb has set up?
This is how I would like to set up my domain, but when I attempted to, it wouldn't work (and I'm not sure why). I checked DNS propogation, and things looks good, but when browsing to my domain, things wouldn't work.
2) Can I set up subdomains to work with elastic beanstalk? (eg. sub.example.com)
I read somewhere that subdomains cannot be set up in elastic beanstalk, but I don't understand why this would be. I'd like to have one app running at sellers.example.com and one at buyers.example.com. Can I do this with eb? If not, can I set this up on an ec2 instance and configure it myself?
For (1), if elasticbeanstalk.com name servers will respond to requests for domains under elasticbeanstalk.com domain.
You can checkout the following guide on how to setup your custom domain name to point to your elastic beasntalk app:
http://compositecode.com/2014/01/23/mapping-domain-names-w-name-com-and-amazon-route-53/
For (2), if you have two environments myenv1 and myenv2 then you can set up custom cname prefixes for each environment like myenv1.elasticbeanstalk.com and myenv2.elasticbeanstalk.com. What kind of subdomains would you prefer?
If these are sub domains under your own domain, I guess you could set them up depending on your DNS hosting provider.