mirror of https://github.com/pulumi/pulumi.git
c173258b37
The trickiest job we do while parsing the import file is name disambiguation. The name of an import serves as both the logical name of the imported resource (e.g. "foo" in `new aws.s3.Bucket("foo")`) and as the name of the resource's definition (e.g. `foo_1` in `const foo_1 = new aws.s3.Bucket("foo")`). The logical name of the resource need only be unique within its qualified type--that is, two resources may have the same logical name if they are of different types or have different ancestors--but the name of the resource's definition must always be unique. Other systems that serve as input for import (notably Terraform) also have this sort of peculiar type-based namespacing. We often see overlapping names when importing from these systems. In order to make `pulumi import` cooperate nicely with `pulumi convert`, we need the logical names of the imported resource to agree with the logical name of the corresponding converted resource. To address this: - We only change the logical name of a resource if not doing so would cause it to conflict with another resource (i.e. because they end up with the same URN) - We change the definition name of a resource if not doing so would cause its definition in the generated source to conflict with another resource |
||
---|---|---|
.. | ||
authhelpers | ||
backend | ||
cmd/pulumi | ||
codegen | ||
display | ||
engine | ||
graph | ||
importer | ||
operations | ||
resource | ||
secrets | ||
testing/integration | ||
util | ||
version | ||
workspace | ||
README.md | ||
go.mod | ||
go.sum |
README.md
pulumi/pkg
While pulumi/sdk maintains strict backwards compatibility guarantees, code under pkg/ is handled more informally: while breaking changes are still discouraged they may happen when they make sense.