This message was deleted.
# general
s
This message was deleted.
s
( I have run npm install + npm ci on the shared directory, the node modules look to be installing)
b
hey there. I'm a little lost here, why would you share a single
index.ts
across multiple projects? does it have a componentresource in it?
s
The index is identical, I am sharing it across projects and using the config files as a degerminator of what to create. That config file has a list of storageAccounts / appServices (along with other services), which the index uses to create those.
b
is there a reason you can't do this with one project, and 4 stacks? instead of 2 projects with 2 stacks in each?
s
That is a good question and I will look to see if we can do that, however, I am under the impression that we want to keep those separate. In the future there will be 20+ projects, some of which will share the core index.ts file, and some that will require a completely different and more complex implementation.
b
I'm not sure that'll work in the way you intend it to, unless your expect the projects to be different, you should have a single project with 4 stacks. If you want to have reusable code/resources, you should create a ComponentResource and import that into each project
s
We have some wrappers around some Pulumi resource creation that we are importing into the index.ts currently, is that what you mean, or is ComponentResource a different thing?
Okay just read up on here about it - https://www.pulumi.com/blog/creating-and-reusing-cloud-components-using-package-managers/ We are essentially doing this locally in our project for now, we will look to extend what we have and maybe implement this pattern when the project gets more mature. However, I would like continue exploring if sharing index.ts is possible still so we can make that decision of combining the projects later.