also, default values in Pulumi.yaml seem to not wo...
# python
l
also, default values in Pulumi.yaml seem to not work?
w
There is not a concept of "default values in Pulumi.yaml". Curious what led you to think there was? In practice, in the current model, you just put defaults in your program - like:
Copy code
let config = new pulumi.Config()
let thing = config.get("thing") || "defaultThing";
l
all the yaml files looks like this in the example repo:
which suggests you can pick a default value
w
l
yeah, so I'm not sure what that means or how to use it?
w
I see - yes - that is currently just part of the template (
pulumi new
) functionality - which drives the prompts you see during a
pulumi new
operation. This is slightly more clear if you expand the screenshot a little - but definitely understand the confusion. We do expect to make some improvements generally around config in the not-too-distant future - see https://github.com/pulumi/pulumi/issues/1052.
(sorry - meant to attach the image to the reply - somehow Slack sent the image but not the reply).
l
ok, from reading that I assume that the values in the yaml file do not work yet?
w
Pulumi.yaml
is not used for configuration. The current configuration values are stored in
Pulumi.<stackname>.yaml
(confusing that these have similar names - the two files are completely unrelated). Defaults and how the config is used/interpreted is entirely up to the program. Note that this is related to the use of "code" vs. "configuration DSLs" - we lean on the code to do as much of the work as possible.
l
ok, if its not used for configuration, why all examples specify default values for config parameters in it? 🙂 what do those mean? or what are those used for (if anything at all?)
w
Those are in a
template
section which is used when templates are installed via
pulumi new
, or via
New Project
in the Pulumi console.