late-airplane-27955
10/15/2025, 12:50 PMclass ExampleAppCloudResources extends pulumi.ComponentResource {
randomResource: random.RandomString;
anotherRandomResource: random.RandomString;
public readonly secretString: pulumi.Output<string>;
constructor(name: string, opts: pulumi.ComponentResourceOptions) {
super("ExampleAppCloudResources", name, {}, opts);
//console.log("ExampleAppCloudResources constructor");
this.randomResource = new random.RandomString("random", {
length: 16,
special: false
}, { parent: this });
this.secretString = this.randomResource.result;
this.anotherRandomResource = new random.RandomString("another-random", {
length: 16,
special: false
}, { parent: this });
}
}
var exampleApp = new ExampleAppCloudResources("test", {});
var exampleApp2 = new ExampleAppCloudResources("test2", {});
export const secretString = exampleApp.secretString
I would guess pulumi would generate urns based on the component resource "type" and id, but it only generates it based on the type, causing collisions here. To me that seems like a strange design choice, it would make everything more robust with less chance of urn collisions if the entire "tree" was taken into account. Does anyone know how I can control this? I'd hade to have to add {name} as a prefix to every single resource in my component resource. Is there some global setting that can auto-prefix for me?late-airplane-27955
10/15/2025, 1:02 PMechoing-dinner-19531
10/15/2025, 1:10 PMTo me that seems like a strange design choice, it would make everything more robust with less chance of urn collisions if the entire "tree" was taken into account.Yes 😞 a very unfortunate early decision that we're currently stuck with.
Does anyone know how I can control this? I'd hade to have to addNot currently. The advice is to just prefix your component resource name to every child resources name. We really want to change this but the amount of code that depends on the current format of URNs is vastas a prefix to every single resource in my component resource. Is there some global setting that can auto-prefix for me?{name}
late-airplane-27955
10/15/2025, 4:07 PMechoing-dinner-19531
10/15/2025, 4:09 PMlate-airplane-27955
10/15/2025, 4:16 PMlate-balloon-24601
10/22/2025, 2:06 PMsuper(`ebx:component:${type}/${name}`, name, args, pulumi.mergeOptions(opts, ourOpts))
This almost certainly breaks some assumptions within pulumi, but it has worked consistently for over a year nowechoing-dinner-19531
10/22/2025, 2:08 PMNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by