Say, I have a `ComponentResource`, that slowly gro...
# typescript
c
Say, I have a
ComponentResource
, that slowly grows too big to be all in one file. Is it good practice to structure parts of the resources in another file using a function or plain class, so that the "internal" structure is not reflected in the pulumi state, but I still get to make it more readable? Would you prefer a function or a plain class? Or a whole other concept for this?
g
I often use functions for this. You can check out our EKS package for some examples of this: https://github.com/pulumi/pulumi-eks/blob/master/nodejs/eks/cluster.ts#L1135 You’ll notice that this file is still quite long, but all those supporting functions could be moved to separate files.
c
Thanks @gorgeous-egg-16927 🙂