Configuration Files  |  App Engine standard environment for Java 8  |  Google Cloud

were previously called “modules”.

Each version of a service is defined in a .yaml file, which gives the name of
the service and version. The YAML file usually takes the same name as the
service it defines, but this is not required. If you are deploying several
versions of a service, you can create multiple yaml files in the same directory,
one for each version.

Typically, you create a directory for each service, which contains the service’s
YAML files and associated source code. Optional application-level configuration
files (dispatch.yaml, cron.yaml, index.yaml, and queue.yaml) are
included in the top level app directory. The example below shows three services.
In service1 and service2, the source files are at the same level as the YAML
file. In service3, there are YAML files for two versions.

Hierarchy graph of YAML services

For small, simple projects, all the app’s files can live in one directory:

Hierarchy graph of small YAML services

Every YAML file must include a version parameter. To define the default service,
you can explicitly include the parameter service: default or leave the service
parameter out of the file.

Each service’s configuration file defines the scaling type and instance class
for a specific service/version. Different scaling parameters are used depending
on which type of scaling you specify. If you do not specify scaling, automatic
scaling is the default. The scaling and instance class settings are described in
the app.yaml


For each service you can also specify settings that map URL requests to specific
scripts and identify static files for better server efficiency. These settings
are also included in the yaml file and are described in the
app.yaml reference

The default service

Every application has a single default service. You can define the default
service in the app.yaml with the setting
service: default, but it isn’t necessary to do this. All configuration
parameters relevant to services can apply to the default service.

Optional configuration files

These configuration files control optional features that apply to all the
services in an app:

  • dispatch.yaml
  • queue.yaml
  • index.yaml
  • cron.yaml
  • dos.yaml

To deploy updates of these configuration files to App Engine, run the
following command from the directory where they are located:

gcloud app deploy [CONFIG_FILE]

An example

Here is an example of how you would configure the various files in a WAR
directory structure for an application that has two services: a default service
that handles web requests, plus another service (named my-service) for backend

Assuming that the top-level EAR directory is “my-application,” define the file

<?xml version=”1.0″ encoding=”utf-8″ standalone=”no”?>
<appengine-application xmlns=”″>

Create WAR directories for the two services: my-application/default and my-application/my-service.

Now create an appengine-web.xml file in each WAR that specifies the parameters
for the service. The file must include a version name for the service. To define
the default service, you can explicitly include the <service>default</service>
parameter or leave it out of the file. Here is the file
my-application/default/WEB-INF/appengine-web.xml that defines the default

<?xml version=”1.0″ encoding=”utf-8″ standalone=”no”?>
<appengine-web-app xmlns=”″>

The file my-application/my-service/WEB-INF/appengine-web.xml defines the service that will handle background requests:

<?xml version=”1.0″ encoding=”utf-8″ standalone=”no”?>
<appengine-web-app xmlns=”″>

Finally, define the file my-application/META-INF/application.xml that
enumerates the services. Note that the default service should be the first
service listed.

<?xml version=”1.0″


<description>GAE Java SuperFun app</description>

<!– Services –>
<!– The default service should be listed first –>


App Engine will ignore the <context-root> elements, so HTTP clients need not
prepend it to the URL path when addressing a service.


Leave a comment

Your email address will not be published. Required fields are marked *