Is it possible to add an output to the stack witho...
# getting-started
l
Is it possible to add an output to the stack without exporting it from the entrypoint module? I was hoping to be able to register a new output to the stack from within code, but so far my attempts have failed.
a
You shouldn't have any problems doing that. I mainly use Python and almost none of my stack entrypoint modules have exports in them, only sub-modules.
l
In my case I'm using TS. I was expecting to be able to do something along the lines of:
Copy code
function someFunction() {
  const stack = pulumi.runtime.getStackResource()
  stack.setOutput(...)
}
But the only way I've found to add top-level outputs to the stack so far is to export a module at the top level and then rely on inheritance, meaning my outputs aren't taking the form I want
f
Are you using the automation api?
l
No, not in this case