Search code examples
google-app-engineservicesubdomain

Deploying a service to a subdomain Google App Engine


I have two services in my Google App Engine project: default and betaversion they are currently, successfully deployed to different domains (e.g., example and otherwebsite), because I can't get the one deployed on the subdomain. what I'd like is for default to be at:

example.com

and for the beta to be at:

beta.example.com

so I only have to maintain 1 domain. I've made and deployed a dispatch.yaml file and added the beta CNAME DNS registration in the app engine settings and with my DNS registrar.

dispatch:
  - url: "example.com/*"
    service: default

  - url: "otherwebsite.com/*"
    service: betaversion
    
  - url: "beta.example.com/*"
    service: betaversion

beta.example.com works, but it's routing to the default service. I feel like I must be missing something small, but it's driving me crazy. Any help or ideas would be appreciated.


Solution

  • In case this helps anyone, the issue was that my updated dispatch.yaml file was inside of an undeployed version of the app.yaml file in the betaversion service.

    If editing the dispatch.yaml file - make sure you also re-deploy the location containing that dispatch file. In my case, deploying it using

    gcloud app deploy service-folder/dispatch.yaml 
    

    did not work unless I also deployed the service as well

    gcloud app deploy service-folder/app.yampl service-folder/dispatch.yaml