I’m trying to include yaml files into app.yaml for Google App Engine

292 Views Asked by At

I want to separate secrets (API Keys, passwords) from app.yaml into their own separated yaml file which is not part of my github project repo.

I have no clue if it’s possible or what the syntax would be to include a file (or keys from another file). I tried searching on Google (for days) but could not find anything that satisfies my needs.

Here is an example of what I'm trying to achieve:

app.yaml:

env_variables:
    INSTANCE_CONNECTION_NAME: example-database-name
    
includes:
    secrets.yaml

and than a secrets.yaml file with:

  DB_USER: root
  DB_PASS: foobar
  DB_NAME: example_name
1

There are 1 best solutions below

1
yedpodtrzitko On BEST ANSWER

the variables need to be inside env_variables block:

secrets.yaml

env_variables:
  DB_USER: 'root'

then include this file as you already do:

includes:
  - secrets.yaml

Although in long term I'd recommend to use Secrets Manager for saving the secrets.