https://pulumi.com logo
Title
n

numerous-processor-60508

07/09/2020, 8:38 AM
I'm trying to refactor my code so that my networks are moved from their current project / stack into a new project specifically for networking, as it's going to be referenced more often. I've tried adding an alias, but it keeps saying it wants to create new resources? Anyone got any ideas?
c

colossal-room-15708

07/09/2020, 8:51 AM
You could use import in your new stack instead? https://www.pulumi.com/docs/guides/adopting/import/
n

numerous-processor-60508

07/09/2020, 9:00 AM
Once I've imported it, can I remove that reference from the other project without it being deleted when "pulumi up"?
c

colossal-room-15708

07/09/2020, 9:26 AM
You'll have to do some state "magic" I'd assume. Export the state to local file, remove the resource, and references, then import the state again. https://www.pulumi.com/docs/reference/cli/pulumi_stack_export/
@tall-librarian-49374 correct me please if I'm talking stupid stuff
t

tall-librarian-49374

07/09/2020, 9:32 AM
there’s a command
pulumi state delete
to do that without messing with the state manually
There is an issue for moving, feel free to comment/upvote https://github.com/pulumi/pulumi/issues/3389
n

numerous-processor-60508

07/09/2020, 9:40 AM
Have done, thank you
when deleting the state, what am I referencing exactly, the pulumi URN?
t

tall-librarian-49374

07/09/2020, 9:46 AM
yes, help for this command has an example
n

numerous-processor-60508

07/09/2020, 9:58 AM
I've upvoted the issue, and recommended that perhaps a recipe of steps in how to move resources between stacks would be very helpful to newbies like myself
One for your blog maybe Mikhail 😉
c

colossal-room-15708

07/09/2020, 11:43 AM
Oh cool, didn't know about the
state delete