Show / Hide Table of Contents

Class Output<T>

Output<T>s are a key part of how Pulumi tracks dependencies between Resources. Because the values of outputs are not available until resources are created, these are represented using the special Output<T>s type, which internally represents two things: an eventually available value of the output and the dependency on the source(s) of the output value. In fact, Output<T>s is quite similar to Task<TResult>. Additionally, they carry along dependency information.

The output properties of all resource objects in Pulumi have type Output<T>.
Inheritance
object
Output<T>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
Namespace: Pulumi
Assembly: Pulumi.dll
Syntax
public sealed class Output<T>
Type Parameters
Name Description
T

Methods

View Source

Apply<U>(Func<T, U>)

Apply<U>(Func<T, Output<U>?>) for more details.

Declaration
public Output<U> Apply<U>(Func<T, U> func)
Parameters
Type Name Description
Func<T, U> func
Returns
Type Description
Output<U>
Type Parameters
Name Description
U
View Source

Apply<U>(Func<T, Input<U>?>)

Apply<U>(Func<T, Output<U>?>) for more details.

Declaration
public Output<U> Apply<U>(Func<T, Input<U>?> func)
Parameters
Type Name Description
Func<T, Input<U>> func
Returns
Type Description
Output<U>
Type Parameters
Name Description
U
View Source

Apply<U>(Func<T, Output<U>?>)

Transforms the data of this Output<T> with the provided func. The result remains an Output<T> so that dependent resources can be properly tracked.

func is not allowed to make resources.

func can return other Output<T>s. This can be handy if you have an Output<SomeType> and you want to get a transitive dependency of it. i.e.:
Output<SomeType> d1 = ...;
Output<OtherType> d2 = d1.Apply(v => v.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 not 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 Output<T>s and a single Output<T> is needed that combines both set of resources, then All<T>(params Input<T>[]) or Tuple<T1, T2, T3>(Input<T1>, Input<T2>, Input<T3>) should be used instead.

This function will only be called execution of a pulumi up request. It will not run during pulumi preview (as the values of resources are of course not known then).
Declaration
public Output<U> Apply<U>(Func<T, Output<U>?> func)
Parameters
Type Name Description
Func<T, Output<U>> func
Returns
Type Description
Output<U>
Type Parameters
Name Description
U
View Source

Apply<U>(Func<T, Task<U>>)

Apply<U>(Func<T, Output<U>?>) for more details.

Declaration
public Output<U> Apply<U>(Func<T, Task<U>> func)
Parameters
Type Name Description
Func<T, Task<U>> func
Returns
Type Description
Output<U>
Type Parameters
Name Description
U
View Source

Create(Task<T>)

Declaration
public static Output<T> Create(Task<T> value)
Parameters
Type Name Description
Task<T> value
Returns
Type Description
Output<T>
View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()
  • View Source
Back to top Copyright 2016-2023, Pulumi Corporation.