!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:
Arguments
store_name- The name of the store to read from (as defined in the
atmos.yamlfile) 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, externally managed values |
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.
Atmos supports type-aware merging of YAML functions and concrete values, allowing them to coexist in the inheritance chain without type conflicts. See the full explanation: YAML Function Merging
Using YQ Expressions
You can use YQ expressions to extract specific values from complex data structures:
Examples
Redis Store
AWS SSM Parameter Store
Azure Key Vault
Google Secret Manager
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,!store.getreads values in cleartext and cannot read stores markedsecret: true. For secrets, mark the storesecret: trueand read it with!secret, which masks values and gates access - Access Control: Ensure your store credentials have permission to access the keys you're trying to retrieve