!store.get
The !store.get
YAML function allows retrieving arbitrary keys directly from a store
without following the Atmos stack/component/key naming convention. This is useful for accessing values stored by external systems
or for retrieving global configuration that doesn't belong to a specific component.
Usage
The !store.get
function is called with two parameters, and optionally a default value and
a YQ query expression:
!store.get <store_name> <key> | default <default-value> | query <yq-expression>
Usage examples:
stack.yaml
Arguments
store_name
- The name of the store to read from (as defined in the
atmos.yaml
file) key
- The exact key name or path to retrieve from the store. This is the literal key as it exists in the store, not constructed from stack/component/key patterns
default-value
- (optional) The default value to return if the key is not found in the store
yq-expression
- (optional) YQ expression to retrieve individual values from the result
You can use Atmos Stack Manifest Templating in the !store.get
YAML function expressions.
Atmos processes the templates first, and then executes the !store.get
function, allowing you to provide the key name
dynamically.
Key Differences from !store
Feature | !store | !store.get |
---|---|---|
Key Format | Constructs key from stack/component/key pattern | Uses exact key as provided |
Use Case | Retrieve Atmos-managed component outputs | Retrieve arbitrary values from external systems |
Key Pattern | prefix/stack/component/key | Any format the store supports |
Typical Usage | Cross-component dependencies | Global configs, external secrets |
If you need to retrieve values that follow the Atmos stack/component/key pattern, use the
!store
function instead, as it provides better integration with Atmos component dependencies.
Using YQ Expressions
You can use YQ expressions to extract specific values from complex data structures:
stack.yaml
Examples
Redis Store
stack.yaml
AWS SSM Parameter Store
stack.yaml
Azure Key Vault
stack.yaml
Google Secret Manager
stack.yaml
Considerations
- Exact Key Matching: The key you provide must match exactly how it is stored in the backend, including any required prefix, path, or normalization specific to that store
- External Systems: This function is ideal for interoperability with values written by external systems that don't follow Atmos naming conventions
- Performance: Direct key access is typically faster than pattern-based retrieval since no key construction is needed
- Security: Like
!store
, using!store.get
with secrets will expose them tostdout
in describe commands - Access Control: Ensure your store credentials have permission to access the keys you're trying to retrieve