Thanks for the quick response. I don’t fully understand and perhaps I am missing something, so let me
expand
I have a key in the datastore containing some configuration data and I would like to extract the relevant
parts of this after I have obtained it from the datastore.
The data in the store looks like this
{
"homebridge": {
"compute_size": "Medium Instance",
"name": "homebridge",
"os": "debian-10.0",
"service": "homebridge"
},
"plexmedia": {
"compute_size": "Medium Instance",
"name": "plexmedia",
"os": "debian-10.0",
"service": "plexmedia"
}
}
And my code looks like this
version: 1.0
description: Stackstorm Test Action
input:
- terraform_vars
vars:
- var_config: null
- var_service: homebridge
tasks:
task1:
action: st2.kv.get_object
input:
key: cloudstack_config
next:
- when: <% succeeded() %>
publish:
- var_config: <% result().result.homebridge %>
output:
- vars: <% ctx(var_config) %>
I want to be able to make the selection of the query based on the variable var_service
<% result().result.homebridge %>
Is this possible ?