Hello the great Pulumi community, In one of my si...
# automation-api
Hello the great Pulumi community, In one of my side project, I need to destroy ephemeral infrastructures and when I destroy them, I also want to remove the associated config files (state). These files are empties, and it's better to remove them from the bucket dedicated to testing. With Pulumi automation, I didn't find, in the destroy method, a way to pass the --remove option I saw a method remove_config, but it allows to delete a key from config but not the config file itself. I am using the Python sdk for Pulumi automation Do you know if it's possible to remove the stack and the config files with the Automation API and the Python SDK ? With the CLI it's possible via the --remove option when we invoke the destroy command : https://www.pulumi.com/docs/cli/commands/pulumi_destroy/ Thanks for your help 🙏
Hi Mazlum. I don't think it's possible right now. There's actually a year-old PR to sort this (https://github.com/pulumi/pulumi/pull/11080) that I'm trying to get over the line at the moment, but unfortunately it's not possible just yet.
Hi Will. Thanks for your help 🙏 Your PR is for NodeJs not for the Python SDK, right ?
I have a solution now, but it's not elegant. I overloaded the method "destroy" method from the Stack class and added the argument "remove" by myself. I will submit a PR after to help the community. If there is another solution now, I'll take it 🙂
Noice @full-cpu-27588!