Thread
#general
    s

    steep-island-39848

    2 months ago
    Hi, I am using the automation API and to test certain workflows that use infrastructure that’s managed by Pulumi I’d like to run tests in one stack per test each. That works, but now I am accumulating empty stacks. Is there a way to remove a stack programmatically, i.e. other than through
    pulumi stack rm
    ?
    stack.Destroy()
    only removes resources, but keeps the stack itself.
    q

    quiet-laptop-13439

    2 months ago
    stack.Workspace().RemoveStack()
    maybe?
    w

    worried-rain-74420

    2 months ago
    Unrelated to the Automation API, earlier today I noticed there’s no CLI flag for that behavior. Over the weekend that feature was also requested as part of the GH Action. https://github.com/pulumi/actions/issues/681
    s

    steep-island-39848

    2 months ago
    Simas your suggestion worked, thank you! 🙏