Config Files Reference

Last updated 3 days ago

Below is the schema reference for the Project and Module garden.yml configuration files. For an introduction to configuring a Garden project, please look at our configuration guide.

The reference is divided into four sections. The first section lists and describes the available schema keys for the project level configuration, and the second section contains the project level YAML schema.

The third section lists and describes the available schema keys for the module level configuration, and the fourth section contains the module level YAML schema.

Note that individual providers, e.g. kubernetes, add their own project level configuration keys. The provider types are listed on the Providers page.

Likewise, individual module types, e.g. container, add additional configuration keys at the module level. Module types are listed on the Module Types page.

Please refer to those for more details on provider and module configuration.

Project configuration keys

project

Configuration for a Garden project. This should be specified in the garden.yml file in your project root.

Type

Required

object

Yes

project.apiVersion

project > apiVersion

The schema version of this project's config (currently not used).

Type

Required

Allowed Values

string

Yes

"garden.io/v0"

project.name

project > name

The name of the project.

Type

Required

string

Yes

Example:

project:
...
name: "my-sweet-project"

project.defaultEnvironment

project > defaultEnvironment

The default environment to use when calling commands without the --env parameter.

Type

Required

string

No

project.environmentDefaults

project > environmentDefaults

Default environment settings. These are inherited (but can be overridden) by each configured environment.

Type

Required

object

No

Example:

project:
...
environmentDefaults:
providers: []
variables: {}

project.environmentDefaults.providers[]

project > environmentDefaults > providers

A list of providers that should be used for this environment, and their configuration. Please refer to individual plugins/providers for details on how to configure them.

Type

Required

array[object]

No

project.environmentDefaults.providers[].name

project > environmentDefaults > providers > name

The name of the provider plugin to use.

Type

Required

string

Yes

Example:

project:
...
environmentDefaults:
providers: []
variables: {}
...
providers:
- name: "local-kubernetes"

project.environmentDefaults.variables

project > environmentDefaults > variables

A key/value map of variables that modules can reference when using this environment.

Type

Required

object

No

project.environments[]

project > environments

A list of environments to configure for the project.

Type

Required

array[object]

No

Example:

project:
...
environments:
- name: local
providers:
- name: local-kubernetes
variables: {}

project.environments[].providers[]

project > environments > providers

A list of providers that should be used for this environment, and their configuration. Please refer to individual plugins/providers for details on how to configure them.

Type

Required

array[object]

No

project.environments[].providers[].name

project > environments > providers > name

The name of the provider plugin to use.

Type

Required

string

Yes

Example:

project:
...
environments:
- name: local
providers:
- name: local-kubernetes
variables: {}
- providers:
- name: "local-kubernetes"

project.environments[].variables

project > environments > variables

A key/value map of variables that modules can reference when using this environment.

Type

Required

object

No

project.environments[].name

project > environments > name

Valid RFC1035/RFC1123 (DNS) label (may contain lowercase letters, numbers and dashes, must start with a letter, and cannot end with a dash), cannot contain consecutive dashes or start with garden, or be longer than 63 characters.

Type

Required

string

Yes

project.sources[]

project > sources

A list of remote sources to import into project.

Type

Required

array[object]

No

project.sources[].name

project > sources > name

The name of the source to import

Type

Required

string

Yes

project.sources[].repositoryUrl

project > 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

string

Yes

Example:

project:
...
sources:
- repositoryUrl: "git+https://github.com/org/repo.git#v2.0"

Project YAML schema

project:
apiVersion: garden.io/v0
name:
defaultEnvironment: ''
environmentDefaults:
providers:
- name:
variables: {}
environments:
- providers:
- name:
variables: {}
name:
sources:
- name:
repositoryUrl:

Module configuration keys

module

Configure a module whose sources are located in this directory.

Type

Required

object

Yes

module.apiVersion

module > apiVersion

The schema version of this module's config (currently not used).

Type

Required

Allowed Values

string

Yes

"garden.io/v0"

module.type

module > type

The type of this module.

Type

Required

string

Yes

Example:

module:
...
type: "container"

module.name

module > name

The name of this module.

Type

Required

string

Yes

Example:

module:
...
name: "my-sweet-module"

module.description

module > description

Type

Required

string

No

module.repositoryUrl

module > 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: #

Garden will import the repository source code into this module, but read the module's config from the local garden.yml file.

Type

Required

string

No

Example:

module:
...
repositoryUrl: "git+https://github.com/org/repo.git#v2.0"

module.allowPublish

module > allowPublish

When false, disables pushing this module to remote registries.

Type

Required

boolean

No

module.build

module > build

Specify how to build the module. Note that plugins may define additional keys on this object.

Type

Required

object

No

module.build.command[]

module > build > command

The command to run inside the module's directory to perform the build.

Type

Required

array[string]

No

Example:

module:
...
build:
...
command:
- npm
- run
- build

module.build.dependencies[]

module > build > dependencies

A list of modules that must be built before this module is built.

Type

Required

array[object]

No

Example:

module:
...
build:
...
dependencies:
- name: some-other-module-name

module.build.dependencies[].name

module > build > dependencies > name

Module name to build ahead of this module.

Type

Required

string

Yes

module.build.dependencies[].copy[]

module > build > dependencies > copy

Specify one or more files or directories to copy from the built dependency to this module.

Type

Required

array[object]

No

module.build.dependencies[].copy[].source

module > build > dependencies > copy > source

POSIX-style path or filename of the directory or file(s) to copy to the target.

Type

Required

string

Yes

module.build.dependencies[].copy[].target

module > build > dependencies > copy > target

POSIX-style path or filename to copy the directory or file(s) to (defaults to same as source path).

Type

Required

string

No

Module YAML schema

module:
apiVersion: garden.io/v0
type:
name:
description:
repositoryUrl:
allowPublish: true
build:
command:
[]
dependencies:
- name:
copy:
- source:
target: ''