pulumi: Option to disable new stack prompt (if stack does not exist), just fail instead
Hello!
- Vote on this issue by adding a 👍 reaction
- If you want to implement this feature, comment to let us know (we’ll work with you on design, scheduling, etc.)
Issue details
When running commands like pulumi preview against a stack that doesn’t exist, I’m prompted to create the stack. I’d rather see this fail, but I don’t have a way to handle this.
Affected area/feature
CLI
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 22 (16 by maintainers)
I really have no opinion on the interactive mode. I use it only in very simple, experimental situations. But I agree that tools like Pulumi should not force usage patterns. Suggest and recommend, sure, but don’t compel.
This right here demonstrates why this issue should be addressed. Your intuition is completely reasonable. The behavior of the command is not.
Oh wow. Ok so, actually the problem is not only in the interaction but the actual behavior too.
So, I’ll be honest here, I didn’t actually verify that
--stack nonexistent --non-interactive --yesdidn’t create a stack. The signifiers I got from running with--stack nonexistentseparately from--non-interactive --yeslead me to write this issue, thinking that--yeswould answer yes to thewould you like to create this stack?prompt.So at this point, I see several problems. Inconsistent behavior with the
--yesand the undesired “convenience” function, when in interactive mode.@ghostsquad I still don’t understand your use case. I can think of two situations:
pulumiis being run from a script: If a valid stack is not selected, or if the--stackflag is passed and points to a non-existent stack then the command errors. You are not prompted. I include this case since you mention automation, but we don’t prompt when--non-interactiveis passed.pulumimanually: I understand that pressing^Cis annoying, but it sounds like it doesn’t block any workflow. If you want to confirm a stack exists before runningpulumi upyou can usepulumi stack select, which will error on a missing stack. Do the semantics ofpulumi stack select <stack> && pulumi updo what you want us to do?