Hello, I found that I did my first updates in the ...
# general
a
Hello, I found that I did my first updates in the wrong region, so I changed the region using
pulumi config set aws:region eu-west-1
( my resources were previously in us-east-1 ) and I expected pulumi to destroy all my resources in
us-east-1
to create them in
eu-west-1
but pulumi seemed to lost track of my resources then, I couldn't do anything, even destroy. Is that the expected behaviour ?
b
I had the same problem but when I deleted the local project before getting pulumi to destroy the cloud version. It's a bit of an annoying part of Pulumi but probably a necessary evil so that they can avoid using cloudformation.
a
Yeah, I can understand it's not easy to handle region switching like that
b
While I'm not sure how it works, I think they could 'get around this' by just allowing the pulumi cli to use the already stored stack state in the pulumi servers to destroy an existing set of resources
a
Isn't that the case ?
w
I thought we had an issue tracking this - but couldn't find it so I opened https://github.com/pulumi/pulumi/issues/1593. Currently,
pulumi
always uses a single set of configuration for any given cloud provider during an update - so one you change your
aws:region
to
eu-west-1
, all calls to AWS from Pulumi will go to Ireland not Virginia. However, the delete operations on the old resources should instead use the provider configuration that was used to create them. This is something we plan to address. Fortunately, this should be fairly rare, and as you noticed later, you can work around by switching region back, destroying, then moving region forward (or standing up a new stack for the new region and destroying the old stack).
👍 2
b
@able-tomato-34262 it wasn't the case when I tried. I have a stack that still exists in AWS that I can't delete because I removed the files from my laptop and pulumi won't let me run the command to tear the stack down. /shrug
Maybe I'm just doing it wrong
a
Is it not possible to import a state file ?
b
no idea
a
I would know how to do it with terraform if you kept the state file but lost everything else but I don't think you can manually update the state file in pulumi @big-soccer-75859
b
I was thinking about just creating a barebones pulumi project and setting all the config to what it was before and trying to destroy it that way but I'm not sure if that'll work
a
I don't think so since you won't have the same state file on your new stack/project
b
hrmm, fair enough
I wasn't aware there was a state file
a
I'm pretty sure there is one on the pulumi servers for each stack, they need to keep track of the things pulumi configured
b
oh right
well that should be fine
The stack still exists on their servers
a
Yeah, I think so
b
I guess so long as the local config matches the naming of things on their servers I should be able to run the command
I'll give it a go tonight and see if it works
a
Maybe create a new pulumi account and add that account to the organization that was created in the first place
But that makes me wonder : if a stack needs to be updated by more than one person, what's the process for the second person to get the same stack and state file as the first
At least @big-soccer-75859 you can access the list of your resources in your pulumi account, if you don't have that many, you can destroy them by hand
b
yeh
definitely
I'm pretty sure they're tagged in AWS too so I can probably do it there directly
maybe
b
It's possible to export the state using the
pulumi stack export
command (and import it using
pulumi stack import
).
👍 2