https://pulumi.com logo
#general
Title
# general
j

jolly-church-88521

07/13/2022, 10:25 AM
Quick question, I’m trying to re-create access to one of my pulumi infra. What I did is I downloaded
state.json
file from S3 bucket and now I’m trying to do something like this:
Copy code
➜  sandbox git:(main) ✗ pulumi stack import --file state.json
error: this command requires a stack, but there are none
➜  sandbox git:(main) ✗ pulumi stack import --stack eba --file state.json
error: no stack named 'eba' found
Am I missing something? I don’t see any other options for
import
argument. And I see
eba
name in the state.json file:
Copy code
➜  sandbox git:(main) ✗
{
    "version": 3,
    "checkpoint": {
        "stack": "eba", (...)
e

echoing-dinner-19531

07/13/2022, 10:31 AM
stack init
to create a new stack first.
j

jolly-church-88521

07/13/2022, 10:37 AM
Thanks. I still have some issue with the state file:
Copy code
➜  sandbox git:(main) ✗ pulumi stack import --stack eba --file eba.json
error: could not deserialize deployment: unexpected end of JSON input
File looks valid to me (I double checked it with Go).
e

echoing-dinner-19531

07/13/2022, 10:42 AM
How did you check its valid?
j

jolly-church-88521

07/13/2022, 10:42 AM
I have a tool in Go for checking json.
I think it’s working now. I added local storage for the state file:
Copy code
pulumi login file:///...
and I copied file there (without using import):
Copy code
cp state.json state/.pulumi/stacks/eba.json
and now I see stack and resources.
e

echoing-dinner-19531

07/13/2022, 10:44 AM
hmm odd that import didn't like it, I thought the format written by filestate would match what import expected
but glad something worked out
j

jolly-church-88521

07/13/2022, 10:45 AM
According to the documentation it should work 😕 So no idea why I run into this. At least the same file works fine when I move it to the new stack directory 🙂
57 Views