https://pulumi.com logo
Title
a

adamant-translator-31969

03/18/2021, 3:39 PM
Hi! I want to change a variable inside of pulumi.all.apply method ... but when I these method end, values become to original values .... how could this value be maintained?
b

bored-oyster-3147

03/18/2021, 3:52 PM
.Apply(..)
transforms your output so you need to then use your new output going forward.
// receive old output
var oldOutput = ...;

// transform
var newOutput = oldOutput.Apply(...);

// use newOutput
does that help?
a

adamant-translator-31969

03/18/2021, 4:26 PM
I need to save value ouput into string variable.
b

bored-oyster-3147

03/18/2021, 4:32 PM
The output value is asynchronous so it isn't known at compile time, you need to either transform it and continue to pass it around / manipulate it as
Output<T>
or you need to await it so that you can manipulate it synchronously
👍 1