Hi, is there any way to run a function before comm...
# getting-started
i
Hi, is there any way to run a function before command "pulumi up" starts it's planning phase but can still access output of resources?
l
The resources mightn't have been created at that time, right?
But: no. Accessing the value of a resource property can be done only inside an
apply()
, which is a future function that is evaluated during engine execution. After planning, during execution.
A pattern that may help is to split your project into two. The resources that strictly need to be available can be in the first project, and can export the appropriate values as stack references. The resources that depend on those guaranteed-available resources can be in the second project, and use the stack references.
i
Hey thanks, using apply() was the solution.