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

billowy-garage-68819

03/26/2019, 4:51 PM
on the typescript side, I want to run multiple files to cleanly manage separate concerns within one project, however, (I'm new to ts so this may be simple) unless the resources are applied in the index file it doesn't seem to be applying them even when added to the tsconfig.json file, is there something I'm missing?
i.e. I want a network.ts, cluster.ts, addon1.ts, addon2.ts to manage a gke cluster, I wound up having to rename cluster.ts to index.ts for my own sanity, the network stuff applied since it was referred to by the cluster, but the addons didn't (they rely on the cluster and the subsequent kubernetes provider)
g

gentle-diamond-70147

03/26/2019, 4:54 PM
in your index.ts you'll need to
import "./network.ts";
for the resources there to be picked up
https://www.typescriptlang.org/docs/handbook/modules.html#import is a good resource for understanding the different ways to import in TS
the main thing to know is
import * as network from "./network.ts";
won't actually do anything unless you reference something from the import - e.g.
export const networkId = network.networkId;
or similar
but
import "./network.ts";
will "execute" the resources you've defined there
b

billowy-garage-68819

03/26/2019, 5:25 PM
ty, I knew there had to be a way to include the resources to execute but wasn't sure how
o

orange-tailor-85423

03/26/2019, 6:10 PM
the pulumi examples repo is fantastic and even still I forget to go there some times. Definitely check it out for some generic patterns
33 Views