https://pulumi.com logo
#contribute
Title
# contribute
b

bored-activity-40468

09/01/2021, 2:21 PM
Curious to get others' thoughts on this.  In Python I have  POC where I override the init method on the base Resource so I can add logic where, if an empty resource_name is passed, a naming strategy is used to autoname Resources.  I’m wondering if it would be useful to dig into the go and find how the Resource resources are generated and see if it's possible to add this logic higher or maybe there’s some unknown side effect from doing this that I’m missing.  Thanks.
w

white-balloon-205

09/02/2021, 3:10 AM
This sounds along the lines of https://github.com/pulumi/pulumi/issues/1518 and in particular the ideas in https://github.com/pulumi/pulumi/issues/1518#issuecomment-535677365. This is something we’d love to see added to Pulumi. There's some design details that will need to be fleshed out, but if you are interested in working on this, happy to provide pointers on where to start in terms of designing and implementing an approach to this. If what you are looking for is related to fundamentally different to what's there - also interested in capturing your needs either in that issue or a new one.
b

bored-activity-40468

09/02/2021, 3:03 PM
Even though both are the same issue, the 2nd link sounds closest. Does it make sense to build something like that in or just provide a way for it to be built via letting the resource_name be set on a callback, like tags?
Here's what I came up with for auto-naming resources in C#. https://gist.github.com/dbeattie71/36514ffaa14cfdcd34fd9c062e8d03e0