I have a web application running in Google App Engine right now under the default service for the GCP project. Let's say I own a domain domain.com
which is registered and currently serves up a website on a locally managed server separate from Google Cloud.
I want to add the subdomain api.domain.com
to point to the App Engine service but the method of registering custom domains in GCP doesn't really seem too friendly to this scenario. Perhaps I'm misunderstanding their documentation.
Is there a way for me to add a custom subdomain only in my App Engine project (api.domain.com
) that points to my service, while the root domain.com
points to a non-Google Cloud service?
The console is a little confusing in this respect, but it can be done. You start here:
Console -> App Engine -> Settings -> Custom Domains -> Add a Custom Domain
The first step is to pick your domain and here you use the naked domain. You have to prove to Google that you own the domain, but you don't actually need to use the naked domain with Google. Many people don't use the naked domain and instead use www.mydomain.com.
The second step is to pick the subdomain that you want to map to your GAE service and you simply type this in the box.
You'll then set DNS records for A and AAAA for the subdomain so the subdomain maps to GAE.