Note that this could be somewhat dangerous, as you will lose dependency information. So if you take the value resulting from this and use it as an input to another resource, Pulumi will not track the dependency between the resources.
The “right” way to do this in almost all cases is to use .apply.
07/10/2019, 1:08 AM
does a quick audit of her code
rats, i'm using it to generate an asset
wait, can i even track dependency through that?
resource vars -> generated file -> zip archive -> FileAsset -> BucketObject
note to self: add them as explicit dependencies
07/10/2019, 1:14 AM
In principle yes you should be able to track dependencies through that chain. Depends possibly on exactly how you are construct g each step.
But in general, using apply on outputs to do work dependent on the value of an output is the best way to ensure you get accurate previews and dependency tracking.
07/10/2019, 1:15 AM
i'm doing a lot of async that doesn't really track dependencies
i think it'll got lost at the zip bundling stage, since i'm handing that off to a background thread
07/10/2019, 1:17 AM
Ahh - yes - that is of course fine to do as well! Just the connections between resource outputs and resource inputs are where it’s important to pass outputs (and use apply).
07/10/2019, 1:20 AM
yeah, i might have to try to dig in more deeply; the async runs pretty deep in my libraries, i'm making a lot of `Task`s and `Future`s, and dependency tracking is kind of important
(building a lambda package using Pipenv-based dependencies and injecting pulumi-declared resources)