https://pulumi.com logo
#general
Title
# general
t

tall-rose-87315

10/23/2019, 8:41 PM
hmm. that kinda kills the ability to use StackReference to break up the infrastructure. I need to share the kubeconfig. Is there any way to destroy a stack without destroying the items it imported? (I was able to my stacks up so that a second stack imported the ids of the first stack, but then destroying the second stack also destroys the imported resources. )
w

white-balloon-205

10/23/2019, 8:43 PM
import
means take ownership of. If you just want to reference existing resources without taking ownership, you can use
.get(id)
.
t

tall-rose-87315

10/23/2019, 8:44 PM
ah. I missed that. I think maybe I need to take time to read the whole API instead of skimming 🙂
c

cool-egg-852

10/23/2019, 8:52 PM
You can certainly remove a stack without removing the resources
I believe it’s
pulumi stack rm -f stack
t

tall-rose-87315

10/23/2019, 9:57 PM
I have #1 stack that deploys the cluster, and then stack #2 that deploys one of the apps to the cluster. I was trying to destroy the app without destroying the cluster.
c

cool-egg-852

10/23/2019, 10:23 PM
Yeah, you definitely need to use a StackReference then. If you need to fix it for now, you can export the stack, remove the resources, then import the stack.