Closed henrybeen closed 2 years ago
You can add a resource to a stack by adding it to the underlying template, and then redeploy the stack.
There is no other mechanism for this. Is there a scenario for you where that's an issue?
I can see how this works, when you do it once.
What would happen if I try to add the same resource to two stacks this way? Will it be concidered for purge when either stack is udpated? Or will it be detached from the first stack when I add it to the second one?
Currently, nothing restricts a resource being managed by multiple stacks, and in this case, one stack update with UpdateBehavior = PurgeResources
would delete the underlying resource even if another stack is managing it. This is primarily because we don't want to restrict the user from their use cases, and if managing the same resource in two different stacks is the user's design pattern, we adhere to it.
I guess the title says it all: can I add an existing resource to a deployment stack?