Is there an easy way to move state from one projec...
# general
b
Is there an easy way to move state from one project:stack to another project:stack?
a
pulumi stack export > state.json
select the stack you want to import to with
pulumi stack select
then
cat state.json | pulumi stack import
this works if it is a totally empty stack
b
you can just move parts of it? I have one big project, but I want to break out the create of AWS IAM resources into it's own project, but leave the other stuff where it is.
a
ah I feel ya. hmm I don't know any super elegant ways. you can edit the
state.json
file to include what you want, but it's quite tedious. i'm actually currently dealing with a similar challenge 😄
https://www.pulumi.com/docs/reference/cli/pulumi_state_delete/ this works for deleting by ARN, but I can't find anything equivalent for importing
lmk if you figure something better out! would be helpful
b
ok, that works
I know you can add something like
{ id: <arn> }
in the same block that . you would declare the parent and that brings it in. I guess with that and the state delete solves that.
I saw it in a video. trying to find it.
that is a pain, but works. I was hoping for something like tf mv
a
yeah I've been wanting that for a while too! I'm sure it's on devs radar