bitter-coat-39627
12/28/2020, 4:38 AMPulumi.<some-name>.yaml
files work. Right now, I'm doing an experiment and created three separate yaml files:
Pulumi.yaml
Pulumi.dev.yaml
Pulumi.prod.yaml
I added a specific variable to the Pulumi.dev.yaml
and Pulumi.prod.yaml
ones called app:environment
(setting the values to dev
and prod
, respectively) and then added this bit of code to my stack class so I can see the output:
var config = new Config();
var env = config.Require("app:environment");
Console.WriteLine(env);
Now, when I run pulumi up
for my dev
stack, it gives me the following error:
Missing Required configuration variable 'dotnettestservice:app:environment'
It looks like it's looking for it in Pulumi.yaml
, not Pulumi.<env>.yaml
.
I have dotnettestservice
defined under the name:
parameter in my Pulumi.yaml
, not in Pulumi.dev.yaml
, nor Pulumi.prod.yaml
. When I do a pulumi config get app:environment
, it gives me the correct value of dev
.
My question is, am I allowed to have different required parameters based on the stack? Do I have to have a separate name
parameter in each of these so it doesn't try to use the Pulumi.yaml
one?
Also, feel free to let me know if I'm not making sense and need to clarify anything (or if I'm going about this the completely wrong way) 😅 I appreciate any insight you might have ❤️new Config()
as well, but it seemed to be looking in the correct one originally as well 🤔tall-librarian-49374
12/28/2020, 7:33 AMnew Config
looks for config values named dotnettestservice:foo
. You should either
a) Change you yaml
files to contain settings called dotnettestservice:environment
b) Leave the config files as-is and change your code to var config = new Config("app"); config.Require("environment");
pulumi config set environment test
will automatically add the project name to the YAML file. Give it a try.bitter-coat-39627
12/28/2020, 2:14 PMtall-librarian-49374
12/28/2020, 2:20 PM