Closed lukehoban closed 7 months ago
Note that this can be worked around by users by adding an options
block that defines the aliases in the user code:
account:
type: gcp:serviceAccount:Account
# type: gcp:serviceaccount:Account
properties:
accountId: something-totally-weird-1234
project: pulumi-development
options:
aliases:
- urn:pulumi:dev2::centegenixgcp7::gcp:serviceAccount/account:Account::account
Note that this needs to hard code the URNs of the resources, which is slightly cumbersome. Once https://github.com/pulumi/pulumi-yaml/issues/156 is addressed, it will be possible to more simply alias the type name alone, without having to repeat all other parts of the URN.
Between GCP 6. and 7. we changed the Service Account resource from
gcp:serviceAccount:Account
togcp:serviceaccount:Account
as discussed in the migration guide.This works in all other languages, because we codegen an alias between the two, so that there is no visible disruption for users. E.g. https://github.com/pulumi/pulumi-gcp/blob/d02602d583402290228ab266fe00bfaa37c9864b/sdk/nodejs/serviceaccount/account.ts#L162.
In YAML we don't have any codegenerated SDK. But we do read the schema, and I would have expected we would similarly read and apply aliases from the schema.
However, it appears we do not. Deploying this program:
Then swap the two sets of commented lines - to update the version and switch to the new type name. And run preview again.
The result is the following:
Note that there is a "create" and a "delete" there, which there should not be since the resources identity should have stayed the same due to the alias.