AWS API Gateway Custom Domain - amazon-web-services

I am trying to map my api to custom domain. Let's say I have a website hosted through route 53 (example.com ), then I want my the api to be at api.example.com. So, I am following this link, I did everything as it said. But, when I do https://api.example.com/apiresource ,it says cannot resolve DNS. So, I am not sure if I have to setup another hosted zone for api.example.com and create NS record set ? The documentation doesn't say about it. I would appreciate any help.

I solved it by creating host zone for api.example.com.

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.

How to create a sub domain to point to Cloudfront CDN endpoint using a domain managed outside of AWS

We purchased a domain from GoDaddy, for example, say mycompany.com.
My colleague then moved it to Wix.com to publish our marketing site, which will be available at the mycompany.com url. I need to add a subdomain in AWS, pointing to a Cloudfront CDN endpoint.
To shed more light into the current situation, here is a little more info:
When I check GoDaddy, it shows Nameservers, referencing the Wix servers. For DNS, it says We can't display your DNS information because your Nameservers aren't managed by us.
When I check Wix.com, I see that Managed by Third Party, Connected by DNS and still provides the option to transfer to Wix.
Both Godaddy and Wix provide the option to add a subdomain.
I'd rather do that in AWS.
What is my best option here? Should I transfer the domain to AWS and manage it there? If so, how do I then route traffic from mycompany.com to the marketing site?
Is there a way to keep it as is, but still add a subdomain on the AWS side for example.mycompany.com?
I really regret not registering this domain via AWS in the first place, but lesson learned. Any help would be much appreciated.
I am assuming that your DNS is being hosted via wix.com.
If you want to migrate to Route 53 its not actually too hard. Start by setting up a public hosted zone within Route 53 with the domain name you setup.
Next you would want to perform a zone lookup for all your DNS records, you can use Googles DIG Tool with the ANY option or do this via cli by running dig example.com ANY.
Now that you have all the records you will need to create them within your public hosted zone, follow this tutorial if you need any assistance. Do not add the SOA or NS records.
Now that all records have been migrated get the values from the NS record in your public hosted zone and replace the nameservers within GoDaddy to point at these values.
Your DNS will migrate over whichever period the TTL of your previous NS record is set as. Once this has migrated and it working you can add your CNAME record as you originally wanted to add.

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.

Unable to map custom domain to API Gateway (from Godaddy)

I'm trying to set up a custom domain (say, myapi.com) for my API Gateway but am running into problems. The domain is currently registered on GoDaddy. So far, I've followed this tutorial and done the following:
Obtained a certificate for myapi.com and *.myapi.com from the AWS Certificate Manager.
Mapped the domain myapi.com (not *.myapi.com as I don't need it yet) to an API in the API Gateway.
Added a CNAME entry for the resulting "target domain name" in GoDaddy.
Here are the screenshots:
Now here's the problem: When I do ping myapi.com I get: No address associated with hostname. I'm not sure what's causing this, so would really appreciate some help. And while we're at it, are there any other steps I need to perform before this works as expected?
You cannot use a CNAME record at the apex or domain root with standard DNS services. I suggest you try using a hostname for your endpoint and using the CNAME there eg api.example.com.
Alternatively, you can move your DNS to Route 53. The Route 53 system does support aliases at the root domain level, using the Alias record type.
For more information on Alias records in Route 53 see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-choosing-alias-non-alias.html

AWS Route 53 DNS does not resolve

I am developing Mycroft Nutrition and am attempting to switch my domain from pointing at Heroku to an AWS endpoint because I just switched to AWS Lambda for a serverless architecture. My new endpoint is https://usfqa3q0sg.execute-api.us-east-1.amazonaws.com/dev/, which is working fine, and I have set my DNS accordingly:
However, mycroftnutrition.com still is not working. Can anyone point me in the right direction to getting my domain working?
Update
I created a custom domain for my API as per #matt-healy's recommendation and now have this:
I set my DNS to be this but still have no luck:
You've set your DNS entry to point to:
usfqa3q0sg.execute-api.us-east-1.amazonaws.com/dev
which is not a valid domain.
What you want to do is set up a Custom Domain Name in API Gateway which will map the domain name address to the "dev" stage of your API endpoint.
For more information you can view the documentation.