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

bored-car-93231

03/31/2024, 1:38 AM
What are the best practices for setting up repo,file structure, and environment control? I have several isolated products that will be created. There may be services setup for communication between those products.
m

miniature-musician-31262

03/31/2024, 8:05 PM
It’s a great and common question. Have you had a look at this page yet? https://www.pulumi.com/docs/using-pulumi/organizing-projects-stacks/
b

bored-car-93231

03/31/2024, 9:34 PM
Thanks for the reference @miniature-musician-31262! I have not seen this but will look through it and let you know if anything.
f

fast-sandwich-30809

04/01/2024, 10:40 PM
We have been having great success with the "monorepo" pattern. It looks something like this:
Copy code
stacks/
    stackA/
    ... folder per stack
components/
    componentA/
    componentB/
This lets us re-use components throughout multiple stacks.
b

bored-car-93231

04/15/2024, 10:52 PM
@fast-sandwich-30809 sorry for the delay here! What kind of components are these? I'm guessing stackA references componentA?
f

fast-sandwich-30809

04/17/2024, 4:18 PM
@bored-car-93231, no problemo - StackA and StackB are wholly independent stacks, but any components that they may need to share go in the components folder. In this way, you can keep developing new capabilities, and use them in whichever stacks may need them. Components are just modules, in whatever language you're using. I have one "component" for azure function apps, but 30+ stacks can depend on it. It's a good way to keep maintenance focused to one place
b

bored-car-93231

04/18/2024, 8:11 PM
Ah, I like this a lot! It provides a lot of flexibility as well! Thanks for sharing Ethan!
2 Views