How to setup a Subdomain of an existing domain in AWS? - amazon-web-services

I created an Instance (Windows Server 2016) within AWS and the domain URL amazon gave me as below:
ec2-10-212-103-15.us-east-2.compute.amazonaws.com
Then, to create a subdomain I went to Route53 (https://console.aws.amazon.com/route53/home#Dashboard)
Here is the picture of my configurations:
But I still cannot open http://uat.ec2-10-212-103-15.us-east-2.compute.amazonaws.com/
(Note: The IP is made-up)
What do I need more to do?
Thanks

You're getting it wrong. Route53 is for custom domains you purchase from any of source (GoDaddy, Amazon, Namecheap naming a few).
The URL ec2-10-212-103-15.us-east-2.compute.amazonaws.com you've mentioned isn't the domain name. It is actually DNS to your server. If your instance is not behind a NAT gateway then you can directly access it through ec2-10-212-103-15.us-east-2.compute.amazonaws.com else you need to place a load balancer with public accessibility or place instance behind an internet gateway.

Related

How to point AWS API Gateway URL to Google domains subdomain?

I need create a custom url for my aws api gateway. My domain example.com is managed by google domains. Now I need to link my api which has an aws url like xxxxxxxxxx.execute-api.us-east-1.amazonaws.com to a custom subdomain like api.exemple.com .
exemple.com is already setup in google domains. Now I need to add the subdomain. I tried to add :
host name : api.example.com
type : CNAME
ttl : 10 minutes
data : xxxxxxxxxx.execute-api.us-east-1.amazonaws.com
But it doesn't work as I get this following error from postman when testing the new address :
with https
Error: write EPROTO 140376973400152:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc:242:
with http
<H1>403 ERROR</H1>
<H2>The request could not be satisfied.</H2>
Any suggestion ?
Ok maybe this isnt the only way to do it but this is how iv done it before.
First you need to set up and Elastic IP that is linked to your EC2 Instance.
Once you have the IP set up you can then go to Route 53 in your AWS console and set up a hosted zone.
In this hosted zone that you create you would pout the Domain name as api.exemple.com and leave public hosted zone checked and click create hosted zone. Once this zone is created you would go into that zone and click create record which then you will put the elastic IP as the Value area and leave everything as is and click create records.
Once this is done you can go to google and create a A record where api.example.com point to the Elastic IP address.
Sorry i hope this helps i know its a bit confusing but i got it to work this way.

Where to find domain name to existing EC2 instance

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

Subdomain mapping on Go Daddy to HTTPS site on AWS EC2 Instance not working

I have created a subdomain demo.mysite.com which is hosted over godaddy.com. I have successfully mapped the subdomain demo.mysite.com to my AWS elastic IP in the go daddy console
On my AWS EC2 instance my website is secured runing over HTTPS and I have deployed the certificates corresponding to demo.mysite.com on my AWS EC2 instance. Now the problem I am facing is
1 - When I access my subdomain it points to my EC2 instance and the URL in my web browser changes to my Elastic IP ie www.demo.mysite.com --->> https://201.12.34.58:8443/myApp , which must not happen and it must remain as https://demo.mysite.com
2 - And since my URL changes so I start getting the certificate error saying
The certificate is only valid for demo.mysite.com.
Error code: SSL_ERROR_BAD_CERT_DOMAIN
Can someone help in solving these two issues, I feel that if first issues gets solved the second issue will automatically get solved. I am not sure though
Guys I need your help
I suggest to manage your domain DNS with CloudFlare. Add a CNAME record for your subdomain demo which points to that IP. On CloudFlare Console go to Crypto > Origin Certificates. Create a new one with RSA, then import it to AWS Certificate Manager at us-east-1. For the certificate chain use this. Be sure that Always use HTTPS in Crypto tab is on. After some minutes you should be using your domain pointing to AWS with HTTPS working fine.
That's what I did to make a subdomain to work with an AWS API endpoint with SSL.

Using Cloudflare with Amazon EC2 and load balancers

I am running my website on AWS.
I have one load balancer for my two web servers. My load balancer doesn't have a static IP address, it has a domain name.
I want my traffic to come only via the load balancer. I am using Cloudflare's DNS instead of Route 53, because that's what the Cloudflare instructions said.
I cannot add the load balancer's IP as an A record because it is dynamic and cannot be added through Cloudflare's DNS panel (Not like Route 53). Help me I am stuck in this situation. No solution is offered by Cloudflare so far.
Has anyone faced the same issue?
You can set your Cloudflare record as a CNAME alias of your ELB's A record
See:
https://support.cloudflare.com/hc/en-us/articles/200168986-How-do-I-add-a-Amazon-ELB-Elastic-Load-Balancing-record-to-CloudFlare-
I suggest to manage your domain DNS with CloudFlare.
Add a CNAME record for your subdomain demo which points to that IP.
On CloudFlare Console go to Crypto > Origin Certificates. Create a new one with RSA, then import it to AWS Certificate Manager at us-east-1. For the certificate chain use this.
Be sure that Always use HTTPS in Crypto tab is on.
After some minutes you should be using your domain pointing to AWS with HTTPS working fine.
That's what I did to make a subdomain to work with an AWS API endpoint with SSL.
I decided like this:
I created in the cloudflare, in the DNS table, two CNAME records that point to the dns name of the load balancer generated in aws.
The first record created must contain in the "Name" field, the value "www" with the "content" field pointing to the url of the load balancer in aws. The second record, on the other hand, points to root, containing the value "#" in the "Name" field and "Content" pointing to the same load balancer server in "aws".
See the images below for a better understanding.
I've tried with the Cname record with target as Load Balancer DNS name, but the website is not secured.
If you need static IP for your Load Balancer then use Global Accelerator. It will provide you a static IP. After that create an A record with domain name in cloud flare and content with your Static IP provided by Global Accelerator and the Proxy status must be Proxied.

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.