https://pulumi.com logo
#google-cloud
Title
# google-cloud
b

bland-lamp-16797

05/14/2020, 12:44 PM
pulumi destroy stack
? it's not same as
pulumi stack rm
f

future-barista-68134

05/14/2020, 1:02 PM
You can either comment out the line of code for the resource and run
pulumi up
or you can use
Copy code
pulumi destroy --target stringArray

Specify a single resource URN to destroy. All resources necessary to destroy this target will also be destroyed. Multiple resources can be specified using: --target urn1 --target urn2
h

hallowed-rain-9096

05/14/2020, 1:14 PM
are you intending to delete the resource temporarily so that it will get rebuilt the next time you do
pulumi up
or are you trying to remove a resource from your stack entirely? If the former (temporary remove) then
pulumi destroy --target <urn>
is what you need. If the latter, remove the resource from your code and Pulumi will automatically destroy it the next time you do a
pulumi up
e

enough-engineer-49169

05/14/2020, 1:52 PM
Ok, imagine, I need to create a gke cluster for the use of a demo (Scrum style). So, I start it the Thursday morning and end it the friday evening. Another cluster can be start the morning and end it the evening every day. I use ansible for now and I can use the state to make it present or absent.
But It would be really nice to make a ressource present or absent as I want. Without command line but in code.
But maybe I have a solution, I will try out.
Ok, I simply use golang array to dynamize cluster list. And pulumi up manage the rest for me ! Thanks all for your help
Unlike terraform, I can put a dynamic name for the ressource !