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).
bored-table-20691
05/21/2021, 4:58 PM
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
green-musician-49057
05/21/2021, 5:45 PM
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
bored-table-20691
05/21/2021, 6:04 PM
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.
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.