Thread
#automation-api
    s

    silly-smartphone-71988

    1 month ago
    Hi, I'm using
    LocalWorkspace.CreateOrSelectStackAsync
    which works great. But is there a way to remove a stack (not destroy) using pulumi.automation? Right now I have to do it using the CLI pulumi stack rm
    Found it you have to instantiate a Workspace by passing it the same working directory then call
    LocalWorkspace aPulumiWorkspace = await LocalWorkspace.CreateAsync(new LocalWorkspaceOptions() { WorkDir = path });
    
    var StackArgs = new LocalProgramArgs("StackName", path);
                this.Stack = await LocalWorkspace.CreateOrSelectStackAsync(StackArgs);
    
    aPulumiWorkspace .RemoveStackAsync("StackName")
    b

    bulky-yacht-13037

    1 month ago
    This looks like something I’ll need pretty soon. Thanks for sharing!