many-psychiatrist-74327
04/30/2021, 9:46 PMk8s.yaml.ConfigFile
name unique, its sub-resources will have the same names and conflict. I tried using a transformation
option that renames the resources (adding a prefix), but that seems to be ignored by pulumi and the URN conflicts persist. I would’ve thought that the object hierarchy would make the URNs unique, but it doesn’t seem to do so.
Any ideas?foo
and bar
, and I want to apply it to clusterA and clusterB.
even if I do:
new k8s.yaml.ConfigFile(
"clusterA-res",
{ file: "test.yaml" },
{ provider: clusterAProvider }
);
new k8s.yaml.ConfigFile(
"clusterB-res",
{ file: "test.yaml" },
{ provider: clusterBProvider }
);
pulumi still wants to create two resources named foo
and two named bar
, so it fails.
Of course, I could create copies of test.yaml
and rename everything, but that’s obviously undesirable.
Using a transformation like this didn’t work either:
new k8s.yaml.ConfigFile(
"clusterA-res",
{ file: "test.yaml" },
{
provider: clusterAProvider,
transformations: [(obj: any) => {
obj.name = `clusterA-${obj.name}`;
return obj;
}],
}
);
pulumi seems to ignore the renaming