https://pulumi.com logo
#general
Title
# general
r

red-scooter-62880

02/26/2022, 3:22 PM
Hi. How do you automatically name resources based on cloud resource type in Pulumi ?
e

echoing-dinner-19531

02/26/2022, 4:47 PM
Every resource you declare in you Pulumi program needs to be given a unique logical name (it's the first parameter of the resource constructor), this can't really be done automatically. But maybe I've misunderstood what your trying to achieve here?
r

red-scooter-62880

02/26/2022, 5:10 PM
I have the following code to create the naming for the resource based on the project name and stack name, which works, but I would like to improve it, so it is as automated as possible.
e

echoing-dinner-19531

02/26/2022, 5:18 PM
I'm not sure there's much more you could do currently. But this looks like it could be related to https://github.com/pulumi/pulumi/issues/1518 so I'd suggest making a comment there with what your trying to do.
r

red-scooter-62880

02/26/2022, 5:34 PM
@echoing-dinner-19531 Thanks I will try that
g

gentle-account-13294

02/26/2022, 7:52 PM
@red-scooter-62880, i just tried something using
pulumi.Output.all
, check out the example i posted in the slack there just below this thread. Could be useful 🤷
r

red-scooter-62880

02/26/2022, 7:54 PM
@gentle-account-13294 Hmm that might be usefull, I will check that out
4 Views