Hi If I move code into another stack, how can I a...
# getting-started
s
Hi If I move code into another stack, how can I assure the AWS resource that was already created in another stack is recognized? Basically, I move the identical implementation (literally the same code) to create an AWS resource into a new stack. No code changes at all. However,
pulumi up
in the new stack yields an error because the resource already exists in AWS. Is there a way to link these and have a new stack recognize it’s the same one I need, other than removing the resource in the other stack and then
pulumi up
again in the new stack (basically delete and recreate)?
v
you can use
pulumi import
to import existing resources to stacks. examples of how to do this can be found on each resource documentation page
s
Oh, that makes sense. Don't know why I didn't think of that. Thanks!