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

brave-motorcycle-67487

09/15/2023, 5:57 PM
I'm updating our version of aws-native. This includes updating past 0.72.0, which has a bunch of breaking changes to the names of classes and fields (https://github.com/pulumi/pulumi-aws-native/blob/master/CHANGELOG.md#0720-2023-08-04). That's fine (I like the changes, and have made them in the codebase), but I'm trying to figure out a way to make this transition gracefully. The problem is that pulumi seems to believe these are new things. So for instance, it plans to delete an
aws-native:ec2:VPC
and create a just-happens-to-be-the-same
aws-native:ec2:Vpc
. Some of these are annoying to recreate (require maintenance windows and downtime), and others are imported and have
protect=True
because we really can't be recreating them. What I'm trying to figure out is if there's a way to coerce the state db to recognize that these are actually the same things and don't need to change anything in the physical objects, just an internal re-accounting. This seems like it should be possible, but I'm not sure quite how to go about it. (I'll also accept that I'm using a preview module and thus put myself into this problem simple smile )
hmm, maybe a state delete and an import of the resources (as if we're adopting them fresh from something previously created manually)?
s

stocky-restaurant-98004

09/15/2023, 6:38 PM
That's a valid strategy.
r

rich-whale-93740

09/15/2023, 6:53 PM
Depends on the diff. Some may be achievable via alias
b

brave-motorcycle-67487

09/15/2023, 7:29 PM
ah hah! at least tentatively, that does seem to work, with something like
aliases=[pulumi.Alias(type_="aws-native:ec2:VPC")],
. The
type_
field is documented as existing but that's about it, but between the mention of it and examples in the source code and https://github.com/pulumi/pulumi-aws-native/issues/293 to remind me how to construct type names for aws-native, I made some progress
between both of those options I think I should be able to figure out a good plan. Thanks!