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

icy-controller-6092

01/28/2024, 3:38 AM
💥 is it normal for updating/removing the provider option to cause a wipe of all resources from the cloud? the resources were previously created using
provider: runtimeProvider
but then that option was removed in favour of configuring the default provider with the same settings as the runtime-created provider... then when I next ran
up
, all resources were replaced which effectively wiped them because when you (1) create with same ID as new resource, then (2) delete old resource which has same ID, you're effectively deleting it
this could also have something to do with kubernetes, because the create-replacement + delete-replaced loop happened on a Namespace, which I think may have resulted in all resource types inside that namespace getting deleted
c

cuddly-computer-18851

01/28/2024, 3:44 AM
If you change the URN of the provider, it'll re-create all the resources. I don't think this is a great behaviour but..
b

billowy-army-68599

01/28/2024, 5:04 PM
use an alias
i

icy-controller-6092

01/28/2024, 7:27 PM
Will that work when it’s the provider that changed? Ie. going from a provider defined at runtime, to using the default provider (same provider settings)
I only see name, type, parent, stack and project but no way to spec the old provider URN
b

billowy-army-68599

01/28/2024, 7:34 PM
yes
you alias the provider
i

icy-controller-6092

01/28/2024, 8:16 PM
The default provider can be aliased? It would need to be done in the yaml though since there is no provider created in the runtime program when using the default
i

icy-controller-6092

01/28/2024, 8:33 PM
I’m going the other way from your example, ie. From - runtime defined in code To - using default provider with same settings moved to the stacks yaml file
I can see how your example works for someone going from default to runtime provider, but I’m going the opposite direction Specifically because I kept having issues where I would forget to add the provider option when creating new resources
The reason I was creating the provider in code previously was because it needed a stack references to configure properly (kubernetes and Kafka) But I created a shell script that copies the outputs from the infra stack into the yaml file of the app stack, so that I can have the default provider configured properly and not have to keep setting the explicit provider at every resource constructor
b

billowy-army-68599

01/28/2024, 8:37 PM
ah, I understand