Sun Mar 19 2023Go in to GCP and enter your Cloud Run service and click on the
Click on the
Verify the domain. NOTE: You can verify it on the
Google will start to verify that the records are set up correctly. And now, we will set up a new mapping for a subdomain for
Click on
How to do Custom Domain mapping in Cloud Run
So, you have deployed your application to Cloud Run and everything is working out nicely. But now you want to get rid of that default URL that Cloud Run are providing you with and replace it with your nice domain name? If the answer to that question is yes, or if you just want to know how to map your domain to a Cloud Run service, don't look further!
Prerequisites
- A Cloud Run service up and running
- A domain name and a DNS provider (like GoDaddy or similar)
Set up the domain
In this section, we will demonstrate how the set up is done in GCP
Go in to GCP and enter your Cloud Run service and click on the MANAGE CUSTOM DOMAINS
button
Click on the ADD MAPPING
button
Select the service you want to do the mapping to and enter the domain name that you own
Verify the domain. NOTE: You can verify it on the webmaster central
and choose the vendor you purchased the domain from, and authenticate from there.
When the domain is verified. It is time to update the DNS records at your provider. You will get the DNS records presented in a pop-up. Copy the values into the DNS settings at your providers website.
Google will start to verify that the records are set up correctly. And now, we will set up a new mapping for a subdomain for www.yourdomain.com
.
Click on ADD MAPPING
again and select your verified domain and then type in the domain with www. as prefix.
And at last, the CNAME should be updated at the providers website as well.
That's it!
Now everything is done. NOTE: It can take several hours for the DNS to be properly propagated and be fully functional, so if it doesn't work for you immediately, don't worry.
I hope this guide will help you set up your domain to point to your Cloud Run service. See you in the next one!
Sun Mar 19 2023
See all our articles