hi all, is it expected that dynamo tables and cogn...
# sst
a
hi all, is it expected that dynamo tables and cognito user pool wouldn’t be deleted with
sst remove
?
s
That's correct. I forget the terminology, but those resources default to not being deleted when the stack is torn down. If you want that behavior, you need to specify it when creating the resource
a
thanks. That makes sense. I remember seeing that option before but didn’t realize it is for this purpose 💡
s
Yeah, it's a way to be explicit around deleting what is probably meant to be a persistent resource
a
wonder if it makes sense to auto reuse these tables if I redeploy my stack again instead of throwing a name conflict error
f
Thanks @Seth Geoghegan, yup removal policies!
@arda once you remove a stack and retain a table, the table becomes orphaned, it doesn’t belong to any stacks.
And when you create a new stack, you can’t tell it to re-use an existing table.
This applies to all AWS resources. You can’t not reuse an existing resource in a new stack.
There is a way around this which is to import an existing resource into a stack - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import.html