Configurationยป
While Spacelift stacks typically link source code with infrastructure resources, the configuration is what keeps everything together. Configuration includes anything that affects the behavior of resource definitions found in the "raw" source code, including access credentials, backend definitions, and user-defined variables.
This section focuses on three aspects of configuration:
- Direct stack environment: Environment variables and mounted files.
- Contexts: Environments (often partially defined) shared between stacks and/or OpenTofu/Terraform modules.
- Runtime configuration: Configuration as defined in the
.spacelift/config.ymlfile.
Precedenceยป
Some configuration settings can be defined on multiple levels. If they're over-defined (the same setting is defined multiple times), the end result will depend on generic rules of precedence.
These rules of precedence will be the same for all applicable settings:
- Stack-specific runtime configuration.
- Common runtime configuration.
- Configuration defined directly (either through the environment, or settings) on the stack.
- Anything defined at the context level. Furthermore, contexts can be attached with a priority level further defining the exact precedence.