https://pulumi.com logo
a

acoustic-toothbrush-71581

12/16/2019, 11:24 PM
I'm trying to use pulumi with the program in one directory and the stack files in another. e.g.
Copy code
❯ tree
.
├── program
│   └── index.ts
└── stack
    ├── Pulumi.my-stack.yaml
    └── Pulumi.yaml
is this feasible?
c

colossal-plastic-46140

12/16/2019, 11:29 PM
Check out the main and config keys
a

acoustic-toothbrush-71581

12/16/2019, 11:32 PM
ah interesting.
I assume this can't use something like an interpolated env var in the config file?
w

white-balloon-205

12/16/2019, 11:35 PM
How would you want that to work?
a

acoustic-toothbrush-71581

12/16/2019, 11:40 PM
Well I guess I should take it back one step. I have pulumi and the program packaged into a container. Then I want the user to have the stack/project file on their local file system, run the container with the stack and project file mounted.
so I guess what I was thinking would be that
Copy code
# Pulumi.yaml
main: ${PULUMI_MAIN}/foobar.js
I suspect my use case is a bit odd compared to most users.
w

white-balloon-205

12/17/2019, 12:14 AM
Where do you want
PULUMI_MAIN
to come form? Is that an environment variable?
a

acoustic-toothbrush-71581

12/17/2019, 12:27 AM
yes, e.g.
PULUMI_MAIN=foo/bar/index.ts pulumi up
However I've discovered the config file can be site via flag so that might be a bit moot at least for me now.
It might actually be good to expose the
main
entrypoint as a cli flag.
pulumi up --entrypoint=/tmp/index.ts
w

white-balloon-205

12/17/2019, 12:29 AM
Yeah - we could in principle add first class support for templating into these files - but I think it may actually be better/cleaner to make that something you do elsewhere in your workflow as part of creating these files. In general, it makes these files harder to manage (not just for us, but for any other tools) if they aren't truly YAML/JSON.
a

acoustic-toothbrush-71581

12/17/2019, 12:30 AM
but I think it may actually be better/cleaner to make that something you do elsewhere in your workflow as part of creating these files.
Agreed.
@white-balloon-205 any thoughts on having the entrypoint be a flag like
--config-file
?