https://pulumi.com logo
Title
a

able-tomato-34262

07/03/2018, 2:13 PM
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

big-soccer-75859

07/03/2018, 2:17 PM
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

able-tomato-34262

07/03/2018, 2:25 PM
Yeah, I can understand it's not easy to handle region switching like that
b

big-soccer-75859

07/03/2018, 2:27 PM
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

able-tomato-34262

07/03/2018, 2:28 PM
Isn't that the case ?
w

white-balloon-205

07/03/2018, 3:21 PM
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

big-soccer-75859

07/03/2018, 3:24 PM
@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

able-tomato-34262

07/03/2018, 3:25 PM
Is it not possible to import a state file ?
b

big-soccer-75859

07/03/2018, 3:26 PM
no idea
a

able-tomato-34262

07/03/2018, 3:26 PM
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

big-soccer-75859

07/03/2018, 3:27 PM
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

able-tomato-34262

07/03/2018, 3:28 PM
I don't think so since you won't have the same state file on your new stack/project
b

big-soccer-75859

07/03/2018, 3:31 PM
hrmm, fair enough
I wasn't aware there was a state file
a

able-tomato-34262

07/03/2018, 3:32 PM
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

big-soccer-75859

07/03/2018, 3:32 PM
oh right
well that should be fine
The stack still exists on their servers
a

able-tomato-34262

07/03/2018, 3:32 PM
Yeah, I think so
b

big-soccer-75859

07/03/2018, 3:32 PM
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

able-tomato-34262

07/03/2018, 3:33 PM
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

big-soccer-75859

07/03/2018, 3:37 PM
yeh
definitely
I'm pretty sure they're tagged in AWS too so I can probably do it there directly
maybe
b

big-piano-35669

07/03/2018, 3:49 PM
It's possible to export the state using the
pulumi stack export
command (and import it using
pulumi stack import
).
👍 2