Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Route53 route subdomain to AWS Lambda?

I want to route my.domain.com to the url of my lambda function (which I setup and working via the API Gateway). I can't seem to be able to do this. I also can't seem to be able to to CNAME to anything (so my.domain.com results in a dns error when I CNAME it to domain.com). The normal url (domain.com) is routed to a static S3 bucket and is fine.

The domain was bought on GoDaddy. I changed it so that my GoDaddy Name Servers point to those in a Host Zone which I set up via Route53.

like image 736
tt_Gantz Avatar asked Sep 06 '15 11:09

tt_Gantz


People also ask

Can Route 53 invoke Lambda?

The Lambda function is invoked by CloudWatch Events and configured based on a JSON string passed to the function. This sets a number of parameters, including the DNS domain, source DNS server, and Route 53 zone ID. This allows a single Lambda function to be reused for multiple zones.

What Route 53 record type is used to route traffic to another domain or subdomain?

You use an AAAA record to route traffic to a resource, such as a web server, using an IPv6 address in colon-separated hexadecimal format.


1 Answers

You can't make a CNAME on domain root ie. domain.com because it's zone apex.

To be able to do what you're looking for you need to make a CNAME example.domain.com pointing to CloudFront endpoint generated by API Gateway.

You can follow more detailed API Gateway domain setup instructions.

like image 104
adamkonrad Avatar answered Sep 28 '22 04:09

adamkonrad