Also, are outputs only available to the CLI using ...
# getting-started
s
Also, are outputs only available to the CLI using
pulumi stack output myOut
after deployment and the backend gets updated? I.e not simply by specifying a new line
export const myOut = outputs.then(o, => o.myOutput)
. Adding this to my TS file alone results in an error with command above but is displayed with
pulumi preview
. Hence, new outputs won't be available to other stacks until I
pulumi
up
I confirmed this, but is there a way to output with the command without having to deploy that code?
l
No. Stack outputs reflect what's in the Pulumi state, not what's in the code. If you have an output set to value 4, then
up
, then set the value to 5, then the stack output is still 4: it is intentionally the deployed value.
This is the model required by declarative deployment technologies. Code expresses the intention, not necessarily what is deployed. State describes what (Pulumi) believes is deployed.
s
Makes sense. That's what I figured from my understanding but it's great to hear from the experts. Thanks!