Skip to content

Improve documentation for apply #16393

@jkodroff

Description

@jkodroff

A number of fixes related to https://www.pulumi.com/docs/iac/concepts/inputs-outputs/apply/

  • The intro should start immediately with what apply is and what it's typically used for (with a link to each section that demonstrates the usage):
    • Printing output values for debugging Pulumi programs
    • Accessing nested values in complex types (that is, outputs that are objects or dictionaries)
    • Transforming an output by referencing its plain value
  • Refer the reader to Inputs and Outputs for what outputs are and why they are necessary - don't restate that here.
  • Move the note for what all is for as close to the top of the page as possible.
  • Ensure that we call out (warning notes type) not to create resources in apply or all if it is avoidable (and it usually is avoidable) because they will not appear in pulumi preview unless the output's value is known when pulumi preview is run, in which case the preview output would not match the actual changes to resources when pulumi up is run.
  • Remove the link to the gist, as it's not hosted/owned by Pulumi
  • Remove the gigantic example at the top of the page that shows what happens if you try to print a Pulumi Resource since that's already covered in the "how to print a value" example. (Also fixes Apply: Show context for component #11841)
  • Make lifting its own section and add a note per Explain when *lifting* works and when it doesn't #15952. We should also explain the types involved in the example.
  • Add a note that stack outputs cannot be constructed within an apply (Mention that calling export in an apply doesn't work  #11953)

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions