https://pulumi.com logo
#getting-started
Title
# getting-started
s

sticky-answer-6826

05/27/2022, 9:52 PM
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

victorious-church-57397

05/28/2022, 2:55 PM
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

sticky-answer-6826

05/28/2022, 2:57 PM
Oh, that makes sense. Don't know why I didn't think of that. Thanks!
4 Views