Setting Up a Custom Domain for API Gateway without Route53 using Serverless Framework

Search for a command to run...

No comments yet. Be the first to comment.
We’ve tried out lots of apps over time, and honestly—not all of them do what we really need. That’s why I’m writing this blog post: to share some of the challenges we’ve noticed with the Shopify Forms app and hear what others think too. If you’ve fou...
Hey everyone, Dorothi Viki here. For the last decade, I’ve been in the digital marketing trenches. I’ve managed budgets big and small, and I’ve seen firsthand how crucial it is to know what people are saying about you online. When you’re starting out...
If you’re a small business owner, freelancer, or consultant, your website is your storefront. But traditional website development can be expensive, slow, and intimidating. Platforms like SpreadSimple remove these barriers by allowing you to turn Goog...

For SEO professionals, content marketers, freelancers, and consultants, keyword research is non-negotiable. It’s the foundation of any effective search strategy. However, with so many tools behind paywalls, finding a reliable, high-quality, free Goog...
With the rise of AI agents and Claude-specific development environments, understanding Claude Code has become essential for modern developers, freelancers, and consultants. Whether you're building Multi-Component Programs (MCPs) or designing autonomo...
In the world of serverless computing, API Gateway is a crucial component for building and deploying web APIs. While Route53 is a popular choice for managing custom domains, it may not always be the preferred solution.
In this blog post, we will guide you through the process of setting up a custom domain for API Gateway without using Route53. Instead, we'll be using the Serverless framework, a popular open-source framework for building and deploying serverless applications.
Whether you're a beginner or an experienced developer, this guide will provide you with the knowledge and tools you need to set up a custom domain for your API Gateway with ease.
Run the following command in your terminal to create a new Serverless project:
serverless create --template aws-nodejs
Define the custom domain in serverless.yml:
Use serverless-domain-manager for easy use. In your serverless.yml file, add the following code to define the custom domain name:
customDomain:
domainName: example.com
basePath: 'api'
stage: ${self:provider.stage}
createRoute53Record: false
Run the following command to deploy the API Gateway with the custom domain name:
serverless deploy
You've to run the below code to create the domain: serverless create_domain
After running the serverless deploy, you will get the below output. Distribution Domain Name is the one we need to note down.
Serverless Domain Manager Summary
Domain Name
api.example.com
Distribution Domain Name
https://532324pfn.execute-api.us-east-1.amazonaws.com/


Now you've to use the create option from the API Gateway to use the custom domain.
Go to your domain registrar's website and update the nameservers for the custom domain to the ones provided by the output from the sls deploy (for eg: 532324pfn.execute-api.us-east-1.amazonaws.com)

And that's it! You now have a custom domain for your API Gateway that's been set up using the Serverless framework without using Route53.
Please share this post if you think it's going to help someone.
Let's connect,