https://pulumi.com logo
Title
b

bright-orange-69401

03/28/2023, 2:28 PM
Is it possible to alter a resource’s
parent
without triggering a replacement, but in a way that can be versioned in Git and automatically deployed ? (I used to
pulumi stack export
, manually edit then
pulumi stack import
but I wonder if there’s a cleaner way to do this)
l

limited-rainbow-51650

03/28/2023, 2:42 PM
You should be able to do this with
aliases
. Here is a blog article I once wrote before I joined Pulumi: https://www.pulumi.com/blog/cumundi-guest-post/
b

bright-orange-69401

03/28/2023, 3:51 PM
Very cool ! I legit never used
aliases
until now... but it sounds mighty useful Do you know if that can also be applied when altering the
provider
of a given resource ? (I’m using multiple providers in
pulumi-snowflake
because of different roles)
l

limited-rainbow-51650

03/29/2023, 7:26 AM
You can indeed migrate a resource from the default provider to a custom provider without any interruption. Since the provider is itself a resource, you can alias the provider to the
urn
of the default provider. Here is a code snippet in TS showing a similar scenario going from the default AWS provider to an explicit one: https://github.com/pulumi/pulumi/issues/8959#issuecomment-1461297086 So, you don't alias it on the resource itself, but you do it on the attached provider.