gorgeous-architect-28903
12/01/2022, 6:26 PMWithResourceOptions([dependencyResource, providers], func() {
ResourceOne(ctx, name, ...)
ResourceTwo(ctx, name, ...)
})
And have them all automatically get the dependency without having to type it 5 times, or move them around in the tree. Kind of like registering a stack transformation, but not globally.little-cartoon-10569
12/01/2022, 7:43 PMlittle-cartoon-10569
12/01/2022, 7:45 PMconst baseOpts = { parent: someOtherResource };
...
const resX = new Role("resX", { /* ... */, baseOpts);
const resY = new Bucket("resY", { /* ... */, { ...baseOpts, protect: true });
billowy-army-68599
gorgeous-architect-28903
12/02/2022, 11:21 AMpulumi.Parent(res)
-- so now I can do something like:
withCluster := withOpts([DependsOn(cluster), provider])
ResourceX(ctx, name, withCluster)
ResourceY(ctx, name, withCluster, anotherOption)
Which at least saves me a bit of typing, and lets me append additional options to the individual resources easily.