https://pulumi.com logo
f

full-artist-27215

10/20/2021, 5:51 PM
Weird... I've got a stack output that is supposedly being deleted when the corresponding resource gets deleted, but running
pulumi stack
immediately afterward shows the output is still present, and it persists across multiple `pulumi up`s, despite the fact that the underlying resource is long gone. I think I'm going to do some manual surgery on the stack state (using
pulumi stack export
and
pulumi stack import
), but I'm curious if anybody else has come across this before.
l

little-cartoon-10569

10/20/2021, 5:55 PM
Are you still exporting the value and you're expecting the value to go to
undefined
? Or you've deleted the exported constant, and it's still appearing in the outputs?
f

full-artist-27215

10/20/2021, 5:57 PM
I have a function I'm calling that creates a resource and exports a value from that resource. I removed the place where I call that function, and Pulumi deletes the resource (as expected), and the diff indicates that the corresponding output is also deleted, but the output remains.
with the removal of this function's call-site, I should have no more outputs from the stack.
While I've since fixed it manually, I wonder if there is some kind of weird boundary condition going from 1 output to 0 outputs.
l

little-cartoon-10569

10/20/2021, 6:01 PM
I haven't encountered that, but I only ever create outputs via something like
export const x: pulumi.Output<type> = value;
in node. Are you doing it like that, or some other export mechanism?
f

full-artist-27215

10/20/2021, 6:08 PM
it's in Python, so something like
pulumi.export("foo", my_resource.foo)
pretty standard, as far as I know
l

little-cartoon-10569

10/20/2021, 6:09 PM
Yep, looks normal. And you're deleted that code but it remains in the state? That must be a bug.
r

red-match-15116

10/20/2021, 6:10 PM
I feel like I’ve heard this before but I can’t remember the context
Might be worth doing a quick search in the issues to see if anything pops up but if not definitely open an issue
f

full-artist-27215

10/20/2021, 6:44 PM
@red-match-15116 I couldn't find anything that seemed relevant (using various searches on "output"), so I created https://github.com/pulumi/pulumi/issues/8273
👍🏽 1
g

great-sunset-355

10/21/2021, 5:45 AM
Yes I've had this problem if the Output was the last output remaining in the stack!