Is it possible to destroy resources by provider? e...
# general
w
Is it possible to destroy resources by provider? e.g I have resources managed by k8s/aws in the same stack and I want to delete resources under aws only.
e
Not as simply as just by provider, but there is
--target
to limit the destroy operation to only those resources targetted.
l
Or comment out the code! Feature flags are a good option too.
w
thanks for the suggestions guys. Commenting code out is what I am doing atm. The problem is our codebase is not organised by provider e.g all resources go under
/aws
dir and are exposed via an entry file like
index.ts
. But anyway it sounds like it’s not that simply to be implemented. I will re-order them for now.
e
You could try doing some shell magic to get the list of resources.
pulumi stack export
will give a json dump of the whole state, which you could run through a tool like
jq
to grab out all the resource URNs and grep for the ones with "::aws" in them for example.
👍 1