title:Adding a Non-AWS Hosted Custom Domain to an AWS API Gateway without CloudFront
description:How to set up a domain name for AWS API Gateway for a domain that isn't managed through AWS Route 53.
tags:
-blogumentation
-aws
date:2022-04-01T15:37:30+0100
syndication:
-"brid.gy/publish/twitter"
license_code:"Apache-2.0"
license_prose:"CC-BY-NC-SA-4.0"
image:"https://media.jvt.me/770ef46545.png"
slug:"api-gateway-domain"
---
I run a number of services using the [Architect Framework](https://arc.codes), which makes running services on AWS API Gateway really straightforward.
As I wanted slightly nicer URLs for my services, instead of the default API Gateway URLs, I wanted to attach custom domain name. However, one thing that I found a bit frustrating was that a lot of guides that folks have produced to do this require using CloudFront, and I didn't need CloudFront for my purposes.
I thought I should document how I've done it for anyone else going through this in the future.
Note that the screenshots below may come out of sync over time with AWS, but hopefully it will still remain similar enough this can be followed.
First, browse to the API Gateway console and click the `Custom domain names` link in the sidebar:

Next, we `Create` a new domain name, and specify the domain name we want. In my case, I'm setting up the domain name `tiktok-mf2.tanna.dev`.

We need to set up a certificate in Amazon Certificate Manager (ACM) to provide us a secure means of interacting with our API Gateway. Because this is needed as part of the domain name process, we need to click `Create a new ACM certificate` and complete that process before returning.
When we do return, we'll then have a list of endpoints available in the Endpoint configuration box:

Once created, we can see the `API Gateway domain name`, shown below:

This domain name noted above is the domain that we need to CNAME, for instance: