DEV Community

Discussion on: Generating ACM certificates for a Vercel-managed domain.

Collapse
 
wulfmann profile image
Joseph Snell

I don't recall having any other issues. So you're routing a CNAME record to an API Gateway and when you make a request to it, the api isn't hit?

Collapse
 
aecorredor profile image
Alejandro Corredor

Nvm, I had missed adding the API gateway CNAME record to Vercel.

Thread Thread
 
aecorredor profile image
Alejandro Corredor

I had to do this for another one of my projects months later, and I had forgotten the exact steps to get this working. I asked ChatGPT and he helped me remember:

"How can I use a Vercel managed domain in AWS API Gateway?"

You can use a Vercel managed domain with AWS API Gateway by creating a custom domain name in API Gateway and setting up a DNS record with your DNS provider to point the domain to the API Gateway endpoint.

Here are the steps to do this:

In the API Gateway console, choose Custom Domain Names from the navigation pane.

Choose Create and enter a name for your custom domain.

In the Domain Name field, enter your Vercel managed domain name.

Choose the appropriate protocol and security policy for your API.

In the ACM Certificate ARN field, enter the ARN of the SSL certificate for your domain. This can be obtained from the Vercel console.

Choose Create to create the custom domain.

After the custom domain is created, you will need to set up a DNS record with your DNS provider to point the domain to the API Gateway endpoint. The specific steps for doing this will vary depending on your DNS provider, but generally you will need to create a CNAME record that maps the domain name to the API Gateway endpoint.
Enter fullscreen mode Exit fullscreen mode

For example, if the API Gateway endpoint is my-api.execute-api.us-east-1.amazonaws.com and the domain name is my-domain.com, you would create a CNAME record that maps my-domain.com to my-api.execute-api.us-east-1.amazonaws.com.

Once you have set up the DNS record, it can take some time for the changes to take effect. You can check the status of the custom domain in the API Gateway console to see when it is ready to use.

Posting here so others can benefit.