is there a way to set common config to use for all...
# general
o
is there a way to set common config to use for all stacks?
b
I don’t think so, but you can create a separate Pulumi project with a stack that exports common config, and use a StackReference to read that config in your project 🙂
or, I mean, you could just hard code the values in your code, since you want to use the same value for every stack
o
@broad-helmet-79436 Thanks for your response. Lets say if you have multiple applications(say a, b. c..), and different envs (say qa, staging, prod). so each application has the same conf file across all regions, but different values (e,g.. database_user is different for each env) what is the best way to structure ? My understanding -
Copy code
pulumi
  - project-a
      - Pulumi-qa.yaml
      - Pulumi-staging.yaml
      - Pulumi-prod.yaml
  - project-b
      - Pulumi-qa.yaml
      - Pulumi-staging.yaml
      - Pulumi-prod.yaml
but problem is i don't want to have three different configs for an application. instead, i would like to have common config and have nested or structured config yaml file e.g
Copy code
config:
  project-a:db-user
    qa: 'qa-user'
    staging: 'stg-user'
    prod: 'prod-user'
i feel that would ease developers to manage existing configs or add new ones..
b
Ah… I’m not sure then. I don’t think you can combine everything into a single config file 😕
o
oh
b
I suppose you could do what you want with python/typescript/whatever code instead, though
o
yeah... but i am not sure how to handle with secrets in that case
b
add environment name and project name as config variables for everything, and use that to look up the correct object
nope, secrets are hard 😕
o
i can have custom created config and have structured yaml to support three diff environments values, but seems secrets are supported only if you use cli or standard config file that pulumi generate
b
yeah. sorry I can’t be of more help 🙂
o
np, will try to see if i can find more info. Thank you
@white-balloon-205 would appreciate your recommendation on above scenario. Thanks
p
I needed something like this. How I went about it was using a task runner(Gulp) to flatten my configurations before running
pulumi up
. I have a file that has common configs then then the gulp task will combine the common settings and the stack-specific settings into all the
pulumi.stack.yaml
files.