Thread
#general
    j

    jolly-church-88521

    2 months ago
    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:
    ➜  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:
    ➜  sandbox git:(main) ✗
    {
        "version": 3,
        "checkpoint": {
            "stack": "eba", (...)
    e

    echoing-dinner-19531

    2 months ago
    stack init
    to create a new stack first.
    j

    jolly-church-88521

    2 months ago
    Thanks. I still have some issue with the state file:
    ➜  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

    2 months ago
    How did you check its valid?
    j

    jolly-church-88521

    2 months ago
    I have a tool in Go for checking json.
    I think it’s working now. I added local storage for the state file:
    pulumi login file:///...
    and I copied file there (without using import):
    cp state.json state/.pulumi/stacks/eba.json
    and now I see stack and resources.
    e

    echoing-dinner-19531

    2 months ago
    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

    2 months ago
    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 🙂