atmos stack set
Set a component-relative value for a component in a stack. Atmos uses provenance to find the manifest file that defines the effective value and edits that file in place, preserving comments, anchors/aliases, Atmos YAML functions, and Go templates.
info
atmos stack set is an alias for atmos stack config set, the canonical form.
Usage
atmos stack set <path> <value> -s <stack> -c <component> [--type <type>] [--file <manifest>]
Examples
# Set the value where it currently resolves from. Component vars have no fixed
# schema, so --type=auto (the default) infers from the value already there --
# a bool/int stays a bool/int, not a quoted string.
atmos stack set vars.region us-west-2 -s plat-ue2-prod -c vpc
# A brand-new vars.<name> key with nothing existing to infer from still infers
# correctly if the component's variables.tf declares a type for it -- writes
# an unquoted number, not the string "3", because `variable "replicas" { type
# = number }` says so. This also retypes an existing value if it disagrees
# with the declared type (e.g. a number stored as a quoted string).
atmos stack set vars.replicas 3 -s plat-ue2-prod -c vpc
# Explicit --type skips inference (needed for a brand-new key with nothing to
# infer from, or to override).
atmos stack set settings.spacelift.workspace_enabled true --type=bool -s plat-ue2-prod -c vpc
# Edit (or create the key in) a specific manifest. A brand-new key with no
# Terraform-declared type still infers from its own shape -- "true" is
# written as a bool here, not the literal string "true".
atmos stack set vars.new_flag true --file stacks/deploy/prod.yaml -s plat-ue2-prod -c vpc
Arguments
<path>(required)- Component-relative dot-notation path (e.g.
vars.region). <value>(required)- The value to set, interpreted according to
--type.
Flags
--stack/-s(string, required)- The stack name.
--component/-c(string, required)- The component name.
--type(string, defaultauto)- How to interpret
<value>:auto(infer from the component's declared Terraform variable type forvars.*paths, then from the type of the value already at the path, then from the new value's own shape, falling back to string with a warning),string,int,bool,float,null, oryaml(raw literal). --file(string)- Edit this manifest explicitly instead of resolving via provenance. Required when the value is not yet defined anywhere; can also be used to create new keys.
note
Edits that would alter or expand a YAML anchor or alias are rejected to avoid silently mutating shared data, as are multi-document manifests and manifests that define the same anchor name more than once. Comments, anchors, indentation width, and line endings (CRLF/LF) are preserved, but blank lines between entries are dropped and non-indented sequence styles are normalized when a file is edited.