https://pulumi.com logo
Title
g

gorgeous-printer-90037

02/01/2023, 2:58 PM
Is there any way to get the primitive value of an
Output
without having to do any funky `Apply`s? I’m just trying to read some remote Terraform state and create a new struct with information from there as I see fit, but I see no easy way to do it
e

echoing-dinner-19531

02/01/2023, 3:24 PM
You can but it's not exactly safe: https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v3@v3.53.1/go/pulumi/internals#UnsafeAwaitOutput You should generally just put the code that needs the value inside the Apply call, but if that really can't be done use the above, just be aware your opting out of all the normal output management that the SDK normally does for you
g

gorgeous-printer-90037

02/02/2023, 11:43 AM
I understand the value of the output management, but considering I’m only working with known types and only need to build a Pulumi DAG after the fact, this trade-off is a good deal. Thank you very much!