YAML reference
This document is a reference for the Spacelift configuration keys that are used in the .spacelift/config.yml file to configure one or more Stacks.
Stack settings
Module settings
version
version
The version property is optional and currently ignored but for the sake of completeness you may want to set the value to "1".
stack_defaults
stack_defaults
stack_defaults
represent default settings that will apply to every stack defined in the id-settings map. Any default setting is overridden by an explicitly set stack-specific value.
Key
Required
Type
Description
after_destroy
N
list<string>
List of commands executed after destroying managed resources.
after_init
N
list<string>
List of commands executed after first interacting with the backend (eg. terraform init).
before_destroy
N
list<string>
List of commands executed before destroying managed resources.
before_init
N
list<string>
List of commands executed before first interacting with the backend (eg. terraform init
).
environment
N
map<string, string>
Map of extra environment variables and their values passed to the job
stacks
stacks
The stacks section is a map using stack public ID (slug) as keys and stack settings - described in this section - as values. If you're using this mapping together with stack defaults, note that any default setting is overridden by an explicitly set stack-specific value. This is particularly important for list and map fields where one may assume that these are merged. In practice, they're not merged - they're replaced. If you want merging semantics, YAML provides native methods to merge arrays and maps.
module_version
module_version
Module version is a required string value that must conform to the semantic versioning scheme. Note that pre-releases and builds/nightlies are not supported - only the standard $major.$minor.$patch
format will work.
test_defaults
test_defaults
Test defaults are runtime settings following this scheme that will apply to all test cases for a module.
tests
tests
The tests
section represents a list of test cases for a module, each containing the standard runtime settings in addition to the test-specific settings:
Key
Required
Type
Description
name
Y
string
Unique name of the test case
negative
N
bool
Indicates whether the test is negative (expected to fail)
Last updated
Was this helpful?