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
adventurous-butcher-54166
06/07/2024, 11:06 AM
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
late-balloon-24601
06/07/2024, 11:09 AM
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
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.