This message was deleted.
# golang
s
This message was deleted.
b
It’s hard to read the code as I’m on mobile at the moment, but a few notes. Resource names must have known values when they’re created, so as you noted, it you want to create a resource name from the output of another resource you’d need to do it inside an apply. However Creating resources inside an apply is generally not recommend because it means previews aren’t correct. The best way to move forward for your issue I think is to decide on a name prefix as a string variable and pass that to every resource
So basically, make the project id a string
a
That makes sense but I am struggling to make project Id a string - I could generate a random string but again that's a StringOuput unless I use a golang native rand function which doesn't get committed to state which means on every run it mutates.
b
What I mean is, set the type on the struct as a string instead of a string output and don’t use an apply at all. You can’t convert an output to a string, ever. This may help: https://leebriggs.co.uk/blog/2021/05/09/pulumi-apply.html
a
oooh interesting ok thanks for that i'll try that
appreciate the quick responses Lee! thanks!