Skip to content

Commit

Permalink
Add a paragraph to disambiguate between stack outputs and Output<T> (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
thoward authored Nov 13, 2024
1 parent e71f2c1 commit c93f06b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions content/docs/iac/concepts/inputs-outputs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ In this case, Pulumi is taking the _output_ from one resource and using it as th

All resources created by Pulumi will have properties which are returned from the cloud provider API. These values are called *outputs*.

One important distinction is the difference between a [stack output](/docs/iac/concepts/stacks/#outputs) and a resource output. A stack output is a value that is exported at the end of a successful update, usually intended for use outside of the Pulumi program context, or within another Pulumi program via a [stack reference](/docs/iac/concepts/stacks/#stackreferences). A resource output is something you might use within your Pulumi program to pass a value from one resource to another and compose complex resource topologies. A stack output might be a simple string, but a resource output is a rich object within your program. They are implemented in our [supported language SDKs](https://www.pulumi.com/docs/iac/languages-sdks/) as a generic type Output<T>.

Outputs are a unique and complex type in Pulumi which behave very much like [promises](https://en.wikipedia.org/wiki/Futures_and_promises). Simply put, outputs are a way of representing values that are not initially known but will become available once the infrastructure resource has completed provisioning, and this happens *asynchronously*. This is because the provisioning of resources is an asynchronous operation. It takes time for a cloud provider to complete the provisioning process, and Pulumi optimizes the process by [executing operations in parallel rather than sequentially](/docs/concepts/how-pulumi-works/#creation-and-deletion-order).

Because outputs are asynchronous, their actual plain values are not immediately available. Note that _outputs themselves are not plain/primitive types_, and they cannot be converted into plain types. For example, you cannot turn an a variable of type Output<T> into a regular String or an Integer. An output can only be transformed into another output.
Expand Down

0 comments on commit c93f06b

Please sign in to comment.