Project Configuration
Below is the schema reference for Project configuration files. For an introduction to configuring a Garden project, please look at our configuration guide.
The reference is divided into two sections:
    ​YAML Schema contains the Project config YAML schema
    ​Configuration keys describes each individual schema key for Project configuration files.
Note that individual providers, e.g. kubernetes, add their own project level configuration keys. The provider types are listed on the Providers page.
Please refer to those for more details on provider configuration.

YAML Schema

The values in the schema below are the default values.
1
# Indicate what kind of config this is.
2
kind: Project
3
​
4
# The name of the project.
5
name:
6
​
7
# A list of environments to configure for the project.
8
environments:
9
- # The name of the environment.
10
name:
11
​
12
# Set the default namespace to use. This can be templated to be user-specific, or to use an environment variable
13
# (e.g. in CI).
14
#
15
# You can also set this to `null`, in order to require an explicit namespace to be set on usage. This may be
16
# advisable for shared environments, but you may also be able to achieve the desired result by templating this
17
# field, as mentioned above.
18
defaultNamespace: default
19
​
20
# Flag the environment as a production environment.
21
#
22
# Setting this flag to `true` will activate the protection on the `deploy`, `test`, `task`, `build`,
23
# and `dev` commands. A protected command will ask for a user confirmation every time is run against
24
# an environment marked as production.
25
# Run the command with the "--yes" flag to skip the check (e.g. when running Garden in CI).
26
#
27
# This flag is also passed on to every provider, and may affect how certain providers behave.
28
# For more details please check the documentation for the providers in use.
29
production: false
30
​
31
# The name of the provider plugin to use.
32
name:
33
​
34
# List other providers that should be resolved before this one.
35
dependencies: []
36
​
37
# If specified, this provider will only be used in the listed environments. Note that an empty array
38
# effectively disables the provider. To use a provider in all environments, omit this field.
39
environments:
40
​
41
# Specify a path (relative to the project root) to a file containing variables, that we apply on top of the
42
# _environment-specific_ `variables` field.
43
#
44
# The format of the files is determined by the configured file's extension:
45
#
46
# * `.env` - Standard "dotenv" format, as defined by [dotenv](https://github.com/motdotla/dotenv#rules).
47
# * `.yaml`/`.yml` - YAML. The file must consist of a YAML document, which must be a map (dictionary). Keys may
48
# contain any value type.
49
# * `.json` - JSON. Must contain a single JSON _object_ (not an array).
50
#
51
# _NOTE: The default varfile format will change to YAML in Garden v0.13, since YAML allows for definition of
52
# nested objects and arrays._
53
#
54
# If you don't set the field and the `garden.<env-name>.env` file does not exist,
55
# we simply ignore it. If you do override the default value and the file doesn't exist, an error will be thrown.
56
varfile:
57
​
58
# A key/value map of variables that modules can reference when using this environment. These take precedence over
59
# variables defined in the top-level `variables` field, but may also reference the top-level variables in template
60
# strings.
61
variables: {}
62
​
63
# A list of providers that should be used for this project, and their configuration. Please refer to individual
64
# plugins/providers for details on how to configure them.
65
providers:
66
- # The name of the provider plugin to use.
67
name:
68
​
69
# List other providers that should be resolved before this one.
70
dependencies: []
71
​
72
# If specified, this provider will only be used in the listed environments. Note that an empty array effectively
73
# disables the provider. To use a provider in all environments, omit this field.
74
environments:
75
​
76
# The default environment to use when calling commands without the `--env` parameter. May include a namespace name, in
77
# the format `<namespace>.<environment>`. Defaults to the first configured environment, with no namespace set.
78
defaultEnvironment: ''
79
​
80
# Specify a list of filenames that should be used as ".ignore" files across the project, using the same syntax and
81
# semantics as `.gitignore` files. By default, patterns matched in `.gardenignore` files, found anywhere in the
82
# project, are ignored when scanning for modules and module sources (Note: prior to version 0.12.0, `.gitignore` files
83
# were also used by default).
84
# Note that these take precedence over the project `module.include` field, and module `include` fields, so any paths
85
# matched by the .ignore files will be ignored even if they are explicitly specified in those fields.
86
# See the [Configuration Files
87
# guide](https://docs.garden.io/using-garden/configuration-overview#including-excluding-files-and-directories) for
88
# details.
89
dotIgnoreFiles:
90
​
91
# Control where to scan for modules in the project.
92
modules:
93
# Specify a list of POSIX-style paths or globs that should be scanned for Garden modules.
94
#
95
# Note that you can also _exclude_ path using the `exclude` field or by placing `.gardenignore` files in your source
96
# tree, which use the same format as `.gitignore` files. See the [Configuration Files
97
# guide](https://docs.garden.io/using-garden/configuration-overview#including-excluding-files-and-directories) for
98
# details.
99
#
100
# Unlike the `exclude` field, the paths/globs specified here have _no effect_ on which files and directories Garden
101
# watches for changes. Use the `exclude` field to affect those, if you have large directories that should not be
102
# watched for changes.
103
#
104
# Also note that specifying an empty list here means _no paths_ should be included.
105
include:
106
​
107
# Specify a list of POSIX-style paths or glob patterns that should be excluded when scanning for modules.
108
#
109
# The filters here also affect which files and directories are watched for changes. So if you have a large number of
110
# directories in your project that should not be watched, you should specify them here.
111
#
112
# For example, you might want to exclude large vendor directories in your project from being scanned and watched, by
113
# setting `exclude: [node_modules/**/*, vendor/**/*]`.
114
#
115
# Note that you can also explicitly _include_ files using the `include` field. If you also specify the `include`
116
# field, the paths/patterns specified here are filtered from the files matched by `include`.
117
#
118
# The `include` field does _not_ affect which files are watched.
119
#
120
# See the [Configuration Files
121
# guide](https://docs.garden.io/using-garden/configuration-overview#including-excluding-files-and-directories) for
122
# details.
123
exclude:
124
​
125
# A list of output values that the project should export. These are exported by the `garden get outputs` command, as
126
# well as when referencing a project as a sub-project within another project.
127
#
128
# You may use any template strings to specify the values, including references to provider outputs, module
129
# outputs and runtime outputs. For a full reference, see the [Output configuration
130
# context](https://docs.garden.io/reference/template-strings#output-configuration-context) section in the Template
131
# String Reference.
132
#
133
# Note that if any runtime outputs are referenced, the referenced services and tasks will be deployed and run if
134
# necessary when resolving the outputs.
135
outputs:
136
- # The name of the output value.
137
name:
138
​
139
# The value for the output. Must be a primitive (string, number, boolean or null). May also be any valid template
140
# string.
141
value:
142
​
143
# A list of remote sources to import into project.
144
sources:
145
- # The name of the source to import
146
name:
147
​
148
# A remote repository URL. Currently only supports git servers. Must contain a hash suffix pointing to a specific
149
# branch or tag, with the format: <git remote url>#<branch|tag>
150
repositoryUrl:
151
​
152
# Specify a path (relative to the project root) to a file containing variables, that we apply on top of the
153
# project-wide `variables` field.
154
#
155
# The format of the files is determined by the configured file's extension:
156
#
157
# * `.env` - Standard "dotenv" format, as defined by [dotenv](https://github.com/motdotla/dotenv#rules).
158
# * `.yaml`/`.yml` - YAML. The file must consist of a YAML document, which must be a map (dictionary). Keys may
159
# contain any value type.
160
# * `.json` - JSON. Must contain a single JSON _object_ (not an array).
161
#
162
# _NOTE: The default varfile format will change to YAML in Garden v0.13, since YAML allows for definition of nested
163
# objects and arrays._
164
#
165
# If you don't set the field and the `garden.env` file does not exist, we simply ignore it.
166
# If you do override the default value and the file doesn't exist, an error will be thrown.
167
#
168
# _Note that in many cases it is advisable to only use environment-specific var files, instead of combining
169
# multiple ones. See the `environments[].varfile` field for this option._
170
varfile: garden.env
171
​
172
# Key/value map of variables to configure for all environments. Keys may contain letters and numbers. Any values are
173
# permitted, including arrays and objects of any nesting.
174
variables: {}
Copied!

Configuration Keys

kind

Indicate what kind of config this is.
Type
Allowed Values
Default
Required
string
"Project"
"Project"
Yes

name

The name of the project.
Type
Required
string
Yes
Example:
1
name: "my-sweet-project"
Copied!

environments[]

A list of environments to configure for the project.
Type
Required
array[object]
No

environments[].name

​environments > name
The name of the environment.
Type
Required
string
Yes
Example:
1
environments:
2
- name: "dev"
Copied!

environments[].defaultNamespace

​environments > defaultNamespace
Set the default namespace to use. This can be templated to be user-specific, or to use an environment variable (e.g. in CI).
You can also set this to null, in order to require an explicit namespace to be set on usage. This may be advisable for shared environments, but you may also be able to achieve the desired result by templating this field, as mentioned above.
Type
Default
Required
string
"default"
No
Example:
1
environments:
2
- defaultNamespace: "user-${local.username}"
Copied!

environments[].production

​environments > production
Flag the environment as a production environment.
Setting this flag to true will activate the protection on the deploy, test, task, build, and dev commands. A protected command will ask for a user confirmation every time is run against an environment marked as production. Run the command with the "--yes" flag to skip the check (e.g. when running Garden in CI).
This flag is also passed on to every provider, and may affect how certain providers behave. For more details please check the documentation for the providers in use.
Type
Default
Required
boolean
false
No
Example:
1
environments:
2
- production: true
Copied!

environments[].providers[]

​environments > providers
Deprecated: This field will be removed in a future release.
Type
Default
Required
array[object]
[]
No

environments[].providers[].name

​environments > providers > name
The name of the provider plugin to use.
Type
Required
string
Yes
Example:
1
environments:
2
- providers:
3
- name: "local-kubernetes"
Copied!

environments[].providers[].dependencies[]

​environments > providers > dependencies
List other providers that should be resolved before this one.
Type
Default
Required
array[string]
[]
No
Example:
1
environments:
2
- providers:
3
- dependencies:
4
- exec
Copied!

environments[].providers[].environments[]

​environments > providers > environments
If specified, this provider will only be used in the listed environments. Note that an empty array effectively disables the provider. To use a provider in all environments, omit this field.
Type
Required
array[string]
No
Example:
1
environments:
2
- providers:
3
- environments:
4
- dev
5
- stage
Copied!

environments[].varfile

​environments > varfile
Specify a path (relative to the project root) to a file containing variables, that we apply on top of the environment-specific variables field.
The format of the files is determined by the configured file's extension:
    .env - Standard "dotenv" format, as defined by dotenv.
    .yaml/.yml - YAML. The file must consist of a YAML document, which must be a map (dictionary). Keys may contain any value type.
    .json - JSON. Must contain a single JSON object (not an array).
NOTE: The default varfile format will change to YAML in Garden v0.13, since YAML allows for definition of nested objects and arrays.
If you don't set the field and the garden.<env-name>.env file does not exist, we simply ignore it. If you do override the default value and the file doesn't exist, an error will be thrown.
Type
Required
posixPath
No
Example:
1
environments:
2
- varfile: "custom.env"
Copied!

environments[].variables

​environments > variables
A key/value map of variables that modules can reference when using this environment. These take precedence over variables defined in the top-level variables field, but may also reference the top-level variables in template strings.
Type
Default
Required
object
{}
No

providers[]

A list of providers that should be used for this project, and their configuration. Please refer to individual plugins/providers for details on how to configure them.
Type
Default
Required
array[object]
[]
No

providers[].name

​providers > name
The name of the provider plugin to use.
Type
Required
string
Yes
Example:
1
providers:
2
- name: "local-kubernetes"
Copied!

providers[].dependencies[]

​providers > dependencies
List other providers that should be resolved before this one.
Type
Default
Required
array[string]
[]
No
Example:
1
providers:
2
- dependencies:
3
- exec
Copied!

providers[].environments[]

​providers > environments
If specified, this provider will only be used in the listed environments. Note that an empty array effectively disables the provider. To use a provider in all environments, omit this field.
Type
Required
array[string]
No
Example:
1
providers:
2
- environments:
3
- dev
4
- stage
Copied!

defaultEnvironment

The default environment to use when calling commands without the --env parameter. May include a namespace name, in the format <namespace>.<environment>. Defaults to the first configured environment, with no namespace set.
Type
Default
Required
string
""
No
Example:
1
defaultEnvironment: "dev"
Copied!

dotIgnoreFiles[]

Specify a list of filenames that should be used as ".ignore" files across the project, using the same syntax and semantics as .gitignore files. By default, patterns matched in .gardenignore files, found anywhere in the project, are ignored when scanning for modules and module sources (Note: prior to version 0.12.0, .gitignore files were also used by default). Note that these take precedence over the project module.include field, and module include fields, so any paths matched by the .ignore files will be ignored even if they are explicitly specified in those fields. See the Configuration Files guide for details.
Type
Default
Required
array[posixPath]
[".gardenignore"]
No
Example:
1
dotIgnoreFiles:
2
- .gardenignore
3
- .gitignore
Copied!

modules

Control where to scan for modules in the project.
Type
Required
object
No

modules.include[]

​modules > include
Specify a list of POSIX-style paths or globs that should be scanned for Garden modules.
Note that you can also exclude path using the exclude field or by placing .gardenignore files in your source tree, which use the same format as .gitignore files. See the Configuration Files guide for details.
Unlike the exclude field, the paths/globs specified here have no effect on which files and directories Garden watches for changes. Use the exclude field to affect those, if you have large directories that should not be watched for changes.
Also note that specifying an empty list here means no paths should be included.
Type
Required
array[posixPath]
No
Example:
1
modules:
2
...
3
include:
4
- modules/**/*
Copied!

modules.exclude[]

​modules > exclude
Specify a list of POSIX-style paths or glob patterns that should be excluded when scanning for modules.
The filters here also affect which files and directories are watched for changes. So if you have a large number of directories in your project that should not be watched, you should specify them here.
For example, you might want to exclude large vendor directories in your project from being scanned and watched, by setting exclude: [node_modules/**/*, vendor/**/*].
Note that you can also explicitly include files using the include field. If you also specify the include field, the paths/patterns specified here are filtered from the files matched by include.
The include field does not affect which files are watched.
See the Configuration Files guide for details.
Type
Required
array[posixPath]
No
Example:
1
modules:
2
...
3
exclude:
4
- public/**/*
5
- tmp/**/*
Copied!

outputs[]

A list of output values that the project should export. These are exported by the garden get outputs command, as well as when referencing a project as a sub-project within another project.
You may use any template strings to specify the values, including references to provider outputs, module outputs and runtime outputs. For a full reference, see the Output configuration context section in the Template String Reference.
Note that if any runtime outputs are referenced, the referenced services and tasks will be deployed and run if necessary when resolving the outputs.
Type
Default
Required
array[object]
[]
No

outputs[].name

​outputs > name
The name of the output value.
Type
Required
string
Yes
Example:
1
outputs:
2
- name: "my-output-key"
Copied!

outputs[].value

​outputs > value
The value for the output. Must be a primitive (string, number, boolean or null). May also be any valid template string.
Type
Required
​
​
`string
number
boolean`
Yes
Example:
1
outputs:
2
- value: "${modules.my-module.outputs.some-output}"
Copied!

sources[]

A list of remote sources to import into project.
Type
Default
Required
array[object]
[]
No

sources[].name

​sources > name
The name of the source to import
Type
Required
string
Yes
Example:
1
sources:
2
- name: "my-external-repo"
Copied!

sources[].repositoryUrl

​sources > repositoryUrl
A remote repository URL. Currently only supports git servers. Must contain a hash suffix pointing to a specific branch or tag, with the format: #
Type
Required
​
`gitUrl
string`
Yes
Example:
1
sources:
2
- repositoryUrl: "git+https://github.com/org/repo.git#v2.0"
Copied!

varfile

Specify a path (relative to the project root) to a file containing variables, that we apply on top of the project-wide variables field.
The format of the files is determined by the configured file's extension:
    .env - Standard "dotenv" format, as defined by dotenv.
    .yaml/.yml - YAML. The file must consist of a YAML document, which must be a map (dictionary). Keys may contain any value type.
    .json - JSON. Must contain a single JSON object (not an array).
NOTE: The default varfile format will change to YAML in Garden v0.13, since YAML allows for definition of nested objects and arrays.
If you don't set the field and the garden.env file does not exist, we simply ignore it. If you do override the default value and the file doesn't exist, an error will be thrown.
Note that in many cases it is advisable to only use environment-specific var files, instead of combining multiple ones. See the environments[].varfile field for this option.
Type
Default
Required
posixPath
"garden.env"
No
Example:
1
varfile: "custom.env"
Copied!

variables

Key/value map of variables to configure for all environments. Keys may contain letters and numbers. Any values are permitted, including arrays and objects of any nesting.
Type
Default
Required
object
{}
No
Last modified 1mo ago