how can I get an Output value from StackReference?...
# general
b
how can I get an Output value from StackReference? When I try to use get() on it, there is an error 'Error: Cannot call '.get' during update or preview.', but it doesn't make sense to me, why it's not possible to do that?
c
have you tried using
.apply(f)
? At update time, f will be called with the realized value. eg:
stackref.apply((actualStackRef) => { do_something_with(actualStackRef) })
b
But the result is still of the type Output, isn't it? So I still can't get the underlying value from it
I just don't understand why it's not possible to get values from the Outputs of another stack (which are already fully known and the start of 'pulumi up')
h
Output.apply()
will call the function with the real value
but i'm guessing what you actually mean is "`StackReference.get()` throws an error instead of returning an
Output
)