mirror of https://github.com/pulumi/pulumi.git
66ef108516
Since resource registration is an async operation, we had been using Task<T> to represent output properties. Awaiting the output property would give you the ground value of the output once the registration completed. However, there are cases where we may not have a known value. When previewing, the resource provider may not be able to give back known values for all output properties (for example, consider the case where you are creating a new resource. In this case, the Id property is unknown, because the resource was not created at all). To handle this case, we introduce Output<T>. Unlike Task<T>, Output<T> tracks if the value it represents is "known". In addition, it does not allow you to observe the underlying value directly. Instead, there is a function Apply which allows accessing and transforming the value. However, if the underlying value is unknown (e.g. during preview), Apply will not allow you to observe this state. Note that during previews, some output properties may be present, if the resource provider knows the update would not change them. For example, if you run and update and then preview without changing your code, the cloud provider will known many properties are actually stable. This means applies may run during previews. |
||
---|---|---|
.. | ||
Program.cs | ||
Pulumi.hello-dotnet.yaml | ||
Pulumi.yaml | ||
bucket.csproj |