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

rhythmic-tailor-1242

12/17/2021, 3:49 AM
Hi all, is it possible to have a Pulumi project to allocate resources be broken down into multiple files and folders? similar to how one would structure a Terraform project... For example, inside
dev
I have the file
index.ts
and then inside
dev
I also have another folder
iam
and inside it I have another
index.ts
file. I need
pulumi up
to execute both files. Is it possible?
a

able-hair-32695

12/17/2021, 8:03 AM
This may be better suited for the language specific channels #typescript probably would be the best bet
w

witty-candle-66007

12/17/2021, 2:22 PM
@rhythmic-tailor-1242, There are two constructs worth looking into: • Component Resources: https://www.pulumi.com/docs/intro/concepts/resources/#components • Stack References: https://www.pulumi.com/docs/intro/concepts/stack/#stackreferences Component Resources allow you to create reusable classes that create one or more resources and then can be used across multiple projects/stacks. These can be referenced as local files or centrally stored as modules. Stack References allow a stack to get data from a different stack. This page may also help: https://www.pulumi.com/docs/guides/organizing-projects-stacks/
a

able-hair-32695

12/18/2021, 12:06 AM
@witty-candle-66007 I think they were referencing doing something like this(Currently not working example) https://github.com/M1kep/pulumi-learning/tree/main/github-typescript-with-oidc/src In the teams folders you have the team definitions, and in the repository folders you have the repository definitions. With traditional TF, there was no need to import or anything like that. But with TS, it’s a bit harder. Personally I’m also curious about whether or not there are any ways around this. I’m not hopeful though