Hello! I have a problem with `pulumi stack import`...
# general
r
Hello! I have a problem with
pulumi stack import
. I accidentally used the wrong AWS profile when creating a resource on my pulumi stack. Now pulumi thinks I’ve created a resource when it doesn’t exist in the AWS account that the stack is pointing at. I tried the following steps to fix this: 1.
pulumi stack export > stack.json
2. delete references to the resources I don’t want to have in the stack 3.
pulumi stack import --file stack.json
However, the
pulumi stack import
doesn’t seem to import my changes? I get no interesting output after doing step 3. When trying step 1 again (after having done step 3) I still see the references to the resources that I deleted in step 2. Has anyone else encountered this problem?
v
try running a pulumi refresh between 2 and 3
r
Thanks!
v
i normally also just run
pulumi stack import < stack.json
r
Although I wrote the correct command in this thread, I accidentally ran
pulumi import
in the terminal… I didn’t see this as I referenced my stack using the
--stack
flag. It’s been a long day haha. Sorry for the inconvenience and thanks for the fast reply!
v
no worries mate! glad to have helped
e
I accidentally ran
pulumi import
in the terminal…
Oh oops. I'm surprised this didn't error out with either unrecognized flags or file format.
r
Yea I was also surprised.