Skip to content

Aliased components are recreated instead of preserved: component aliases are not propagated to children #543

Description

@iwahbe

Found by the pulumi v3.256.0 conformance suite's provider-alias-component test (added in pulumi/pulumi testing/pulumi-test-language/tests/provider_alias_component.go): re-parenting a component while giving it an aliases option should preserve the component and everything inside it (the second run expects exactly one create — the new parent). With an HCL-served component, the component's child resources are deleted and recreated instead.

Cause

constructResourceMonitor.RegisterResource (pkg/server/provider.go) forwards the component's own aliases onto the component registration, but child registrations carry no aliases at all. When the component's URN changes (re-parenting), every child's URN changes with it (the parent chain is part of the URN), and with no alias pointing at the old URN the engine sees brand-new resources. SDK-side components handle this by deriving each child's aliases from its parent's aliases; the construct monitor has no equivalent.

Observed: run 2 of the conformance test produces 3 creates (parent + recreated component + recreated child) where 1 is expected, with matching deletes for the old component and child.

The test is parked in expectedFailures in cmd/pulumi-language-hcl/language_test.go until this is fixed.

Metadata

Metadata

Assignees

Labels

kind/bugSome behavior is incorrect or out of specresolution/fixedThis issue was fixed

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions