Hi, How are you modularizing your pulumi code? In general, I end up having multiple .ts files, wher...
b
Hi, How are you modularizing your pulumi code? In general, I end up having multiple .ts files, where I have usually one main function that is imported and called from index.ts. Example: # index.ts import { setupPermissions } from './permissions.ts' setupPermisions(parameterA, parameterB) # permissions.ts export func setupPermisions(a, b) { pulumi resources... }
maybe instead of this should I do a component resource in each module? 🤔
l
There's any number of ways to do it, and they all have their advantages. I always use ComponentResources as it gives me very definite boundaries for unit testing (everything in a ComponentResource) and where I can use elements like
pulumi.runtime
and
pulumi.Config
(index.ts only).
b
yes this is what I am realizing that might feel more natural or "the pulumi way"