This message was deleted.
# general
s
This message was deleted.
b
To give a concrete example, I have a
Namespace
object I create and then use it in most resource creation (I know I could use a provider for this, but let’s say there is a reason I don’t for now).
Another example would be that I create a database in Postgres and a user to use that database, and I want to be able to use both the database name and the credentials in a bunch of places.
g
We're a few weeks into our migration over to Pulumi, and we're using a similar pattern in Golang. One thing we did was break out our infra into multiple Pulumi projects, and then use
StackReference
to import resources across project boundaries. To manage resource dependencies inside the same project, we're defining higher level
struct
types to encapsulate and group resources logically, and pass those structs around. This keeps our functions simpler and prevents parameter bloat.
b
Thanks @green-musician-49057 - good to hear from other experiences. Using
StackReference
makes sense for other stacks, and no issue with that, it’s more the second case you mentioned within the same project/stack, just how to manage the various resources.
g
👍