I'm trying to use pulumi with the program in one d...
# general
a
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
Check out the main and config keys
a
ah interesting.
I assume this can't use something like an interpolated env var in the config file?
w
How would you want that to work?
a
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
Where do you want
PULUMI_MAIN
to come form? Is that an environment variable?
a
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
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
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
?