how to access elastic beanstalk app after linking it to godaddy domain? - amazon-web-services

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.

Related

AWS ALB associated with SSL Certificate using MERN Application

Background of the Application
I have MERN Stack Application running (where frontend reactJS is running inside NodeJS backend server)
The whole application is then wrapped inside Docker Container
Then Deployed in AWS ECS EC2 (using single Service & Task) behind a single Application Load Balancer.
Created a Hosted Zone in AWS Route 53 to Point my domain name to Load Balancer
Now the application is successfully running when I visit my domain name.
Problem Araised Here
The website is "Not Secure"!! — I want to install SSL Certificate
I went to AWS Certificate Manager
Successfully got a certificate by adding CNAME in the AWS Hosted Zone Records
Configured Security Group, Load balancer Listeners to HTTPS
Added that Certificate to Load Balancer listener
Actual Problem
I got the certificate, connected to load balancer,
I can see my certificate in the address bar - "Certificate is Valid"
And still, it shows my the Site is "Not Secure" - Below image is for your reference.
Error in the Console (Edited)
Mixed Content: The page at 'https://example.com/' was loaded over HTTPS, but requested an insecure resource 'http://my-alb-XXXXXXX.us-xxxx-X.elb.amazonaws.com/api/goals'. This request has been blocked; the content must be served over HTTPS.
My Assumption of What Went Wrong
Since AWS ALB has its own DNS Name, which is "Not Secure"
Connecting my new secured domain name TO an unsecured AWS ALB DNS name would be the problem.
Appreciate Your Response
Thank you,
ARUN

Issues configuring AWS Route 53 for Elastic Beanstalk

I am attempting to use a domain registered with Amazon Route 53 to access an Elastic Beanstalk (nodejs) site. I originally had it working ok, but something broke and I can't for the life of me get it to work again.
In summary, I have:
An Elastic Beanstalk environment that is accessible via its url (i.e. ***.ap-southeast-2.elasticbeanstalk.com)
A domain registered through Amazon Route 53
A hosted zone in Route 53, with a document added with Type=A and routing traffic to the Alias (to my Elastic beanstalk environment)
I have edited the named servers in the registered domain to match that of the hosted zone
When I do a "Test Record" from the Hosted Zone, it returns "DNS response code No Error", and returns the IP address of my Elastic Beanstalk application. But, when i go to the URL I get "The Requested Host you requested is not resolvable."
As mentioned, I originally had it working. I then attempted to set up a redirect from http to https via Cloud Front, and managed to break it. I have subsequently removed all https & cloud front config in attempt to get the basic URL access working again. I suspect my issue is that I deleted my default Hosted Zone created by Amazon when I registered the domain, and I have a setting wrong.
Any ideas?
I never got to the bottom of this. Instead created a new elastic beanstalk environment, then reconfigured the domain and certificate to the new instance.
I have no idea what the difference is as all settings appear to be the same. But it at least gave me a way forward.

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/

How to point SSL Enabled custom Sub Domains to Elastic Beanstalk? (without Route53)

I am trying to map an external sub domain into my Elastic Beanstalk Environment. I know, the common way is to use Route53 but I see no use of using it when my client's domain provider has already provided CPanel and stuff to set the CName and things. So, I am about to follow the below method to set domain to Beanstalk.
Login to your provider website and select your domain
Click on "Advanced DNS"
Create a CNAME record.
host: www
value: {{enter-your-subdomain}}.elasticbeanstalk.com.
Create a URL Redirect record.
host: #
value: http://www.{{your-custom-domain}}.com
By doing the above, I expect to have subdomain.example.com instead of subdomain-region.elasticbeanstalk.com
You can see detailed info in this - https://colintoh.com/blog/map-custom-domain-to-elastic-beanstalk-application
I am going to apply this to 2 things.
The REST API which resides in Beanstalk. (Will be used by few mobile and web apps)
The Web Portal app which resides in Beanstalk.
Now, I can see my client already has couple of subdomains for other purposes with SSL enabled. They have purchased SSL from a CA. Therefor, can we enable SSL in CPanel and point the SSL enabled sub domains to Beanstalk? Or we have to reconfigure everything in Route53 and go through their complex process of setting up the SSL?
Using SSL certificates issued by external vendor
From the side of SSL vendor you would need three files : certificate-chain.pem, https-cert.crt and private-key.pem .
Steps would be as follows:
Import certificate to ACM
aws acm import-certificate –certificate file://https-cert.crt
–private-key file://private-key.pem –certificate-chain
file://certificate-chain.pem
Once the import is complete to edit Load Balancer settings in AWS Elasticbeanstalk from Console to choose the imported certificate. For detailed step by step instruction refer https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https-elb.html .
Using SSL certificates from AWS ACM
Steps would be as follows:
Create a Public Hosted Zone in Route 53 with the subdomain in discussion (say app.mydomain.com). AWS will return multiple ns server names.
Create an SOA record in the existing domain registrar for app.mydomain.com pointing to the ns server names returned in step 1.
Go to ACM and create domain validated certificates for app.mydomain.com .
Edit Load Balancer settings in AWS Elasticbeanstalk from Console to choose the new ACM certificates. For detailed step by step instruction refer https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https-elb.html .

add godaddy domain to AWS Elastic Beanstalk site?

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.