https://pulumi.com logo
Title
b

best-horse-36919

03/14/2023, 8:08 AM
I am new to pulumi, and I want to organize my codes as image. However, I do not know how to configure my
index.ts
, which acts as a main entrypoint for pulumi. Any help would be appreciated!
t

tall-lion-84030

03/15/2023, 10:52 AM
You don’t want to export everything as outputs or what would you like to change in your
index.ts
?
b

best-horse-36919

03/15/2023, 10:55 AM
I don't know what I am supposed to export on
index.ts
, and what
index.ts
is for!
t

tall-lion-84030

03/15/2023, 10:59 AM
Every Pulumi program needs an entrypoint. Your
index.ts
act as the entrypoint of your program. Exporting ressource output in your entrypoint will print them in stdout where you run your pulumi program. I suggest not exporting your full modules as your pulumi run outputs will be hard to understand. Just export what is necessary for you to read after your program has been run đź‘Ť
b

best-horse-36919

03/15/2023, 11:06 AM
I see. But I have one more question; how do I make pulumi stack to recognize my resources that I have wrote in Typescript?
t

tall-lion-84030

03/15/2023, 11:10 AM
Just import them in your index like that:
import './src/cloudwatch/log-groups
b

best-horse-36919

03/15/2023, 11:11 AM
And then run
pulumi up
??
t

tall-lion-84030

03/15/2023, 11:11 AM
yes
b

best-horse-36919

03/15/2023, 11:11 AM
oh I meant
pulumi refresh
t

tall-lion-84030

03/15/2023, 11:12 AM
if everything is rightfully setup, you shouldn’t have diff except from your program outputs
b

best-horse-36919

03/15/2023, 2:39 PM
Hmm, only the first resource that I import seems to be recognized by running
pulumi up
. For example, I have a loadbalancer as below in
src/alb/load-balancers.ts
export const planit_dev_ecs_bg_alb = new aws.alb.LoadBalancer(
  "planit-dev-ecs-bg-alb",
  // other options
);
And running
pulumi refresh
only recognizes this Load balancer, but not any other resources.