i'm currently using a local backend for state, and...
# general
h
i'm currently using a local backend for state, and I'd like to migrate to Pulumi's hosted services. Is there a doc on that?
basic google searches only turned up AI articles, which i really don't trust
l
You need the
pulumi login
and
pulumi stack import
commands, they're both documented.
Afaik that should just magically work. The stack file itself won't change, you just copy it into the Pulumi service, and voila.
The only gotcha I can think of would be secrets in your stack config. Do you have any?
h
oh yeah, a bunch
l
I think you'll need to note those all down, because you'll have different secret providers. Once you've moved the stack to the service, you'll need to set them again, and it'll use the service as your encryption key provider.
h
so i need to export them in the clear, migrate, and then import them?
l
Yes, I think so, but I've never done it. Best to try with a fake stack. Create a local project with no resources, set a secret, then export the stack, import it to the service, and see what happens 🙂 The stack itself is a resource, so it should cover all your bases.
h
sigh ok
l
There may be a way to decrypt/re-encrypt via the move stack functionality. Onesec I'll read up on it.
No, it looks like that functionality is service-to-service only.
Doesn't support local stacks.
h
ugh, ok
i guess that's tomorrow's project
l
Good luck!
h
hm, can't force a log in to pulumi cloud if i'm already logged in locally
l
Maybe
pulumi logout
? Not sure, I haven't used a local backend in years, sorry.
h
yeah, i'm just hoping to not break shit
i guess i'll just tarball and export the crap out of things and Experiment™️
l
If you copy your Pulumi.yaml file (that has the
backend:
property), you can roll back easily.
Tarball? Everything should be in source control already, right?
h
not the actual state directory
l
Ah yes. Fair enough.
h
ok, yeah, you can't be logged in to both a local stack store and pulumi cloud
and https://github.com/pulumi/pulumi/issues/11872 means re-importing config is annoying
i can do it as a xonsh one-liner, but i'm still annoyed i have to