Transforms the data of the output with the provided func
. The result
remains an Output so that dependent resources can be properly
tracked.
func
should not be used to create resources unless necessary as func
may not be run during some program executions.
func
can return other Outputs. This can be handy if you have an
Output<SomeVal>
and you want to get a transitive dependency of it,
i.e.
var d1: Output<SomeVal>;
var d2 = d1.apply(v => v.x.y.OtherOutput); // getting an output off of 'v'.
In this example, taking a dependency on d2
means a resource will depend
on all the resources of d1
. It will also depend on the resources of
v.x.y.OtherDep
.
Importantly, the resources that d2
feels like it will depend on are the
same resources as d1
. If you need have multiple outputs and a single
output is needed that combines both set of resources, then pulumi.all
should be used instead.
This function will be called during the execution of a pulumi up
or
pulumi preview
operation, but it will not run when the values of the
output are unknown. It is not available for functions that end up
executing in the cloud during runtime. To get the value of the Output
during cloud runtime execution, use get()
.
Retrieves the underlying value of this dependency.
This function is only callable in code that runs in the cloud post-deployment. At this point all Output values will be known and can be safely retrieved. During Pulumi deployment or preview execution this must not be called (and will throw). This is because doing so would allow output values to flow into resources while losing the data that would allow the dependency graph to be changed.
Generated using TypeDoc
Instance side of the Output type. Exposes the deployment-time and run-time mechanisms for working with the underlying value of an Output.