https://pulumi.com logo
a

adamant-postman-86832

01/16/2020, 4:46 PM
sorry, I mean a pulumi.output
a

astonishing-cartoon-37000

01/16/2020, 4:49 PM
pretty sure there isn't a simple way to "extract" the underlying value from an output. You can do
Copy code
myOutput.apply(val => {
    console.log(val)
})
inside the apply you can access underlying. However for most pulumi stuff you can just pass outputs to Inputs and everything is dandy
w

white-balloon-205

01/16/2020, 5:26 PM
Indeed - as the pinned message in this channel notes:
If your query is related to Output, the answer is generally to use apply. 🙂
This section in the docs has more details: https://www.pulumi.com/docs/intro/concepts/programming-model/#outputs The key point is that an Output may not yet have a value (until a cloud resource has been created or updated), so you cannot just get its value. You need to provide a callback that will run when it’s value does become available (possibly never in the case of a preview).
💯 1