Is it possible to configure a resource to be “aban...
# general
b
Is it possible to configure a resource to be “abandoned” on destroy (i.e. not deleted)? Specifically, I want the state for it to be gone if I do a
pulumi destroy
, but I don’t want the actual resource deleted. An example would be a per-tenant S3 bucket or a database in an RDS instance (where each tenant gets a stack) that houses some data, so that once it is created it won’t get removed, even if I destroy the stack, since this might have some user data that I want to not delete by default. Ideally this would be automatic, i.e. I wouldn’t have to do anything by hand (i.e. manually delete it from the state file). Looking through the docs and Slack history, I couldn’t see an answer, so thought I’d ask here.
b
this isn't really possible at this time I'm afraid
b
Thanks @billowy-army-68599 - that was my assumption given the docs didn’t mention anything, so I’ll have to live with it.
Is it something that would be possible to do in the automation API (i.e. delete the reference to that resource in the stack as part of an automated destroy)? I’m not really sure I want to go down that route but thought I’d check.
b
something to consider: it sounds like basically you want to create an S3 bucket that you "abandon" from the state - if you always want to do that, you could provision the S3 bucket using the standard AWS SDK in the automation API
it should be possible to have the state delete in the automation API i think, but you'll need to open a feature request for it
b
@billowy-army-68599 indeed - that’s easy enough for an S3 bucket, but a bit harder for something like a Postgres database - have to set up connectivity for it, etc. It would also be a bit odd with previews and so on, since that part of provisioning would execute every time, since in Go we do not have dynamic provisioners.
b
yeah i totally get it, i don't think there's a great answer 😞 your best bet would be to segment the projects and on;y run destroy on the resources you definitely want to destroy, I think
b
Yep, makes sense. It is what it is, not the end of the world 🙂