https://pulumi.com logo
#python
Title
# python
l

little-river-49422

02/06/2019, 2:51 PM
also, default values in Pulumi.yaml seem to not work?
w

white-balloon-205

02/06/2019, 4:44 PM
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

little-river-49422

02/06/2019, 4:52 PM
all the yaml files looks like this in the example repo:
which suggests you can pick a default value
w

white-balloon-205

02/06/2019, 4:56 PM
l

little-river-49422

02/06/2019, 5:01 PM
yeah, so I'm not sure what that means or how to use it?
w

white-balloon-205

02/06/2019, 5:01 PM
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

little-river-49422

02/06/2019, 5:05 PM
ok, from reading that I assume that the values in the yaml file do not work yet?
w

white-balloon-205

02/06/2019, 5:16 PM
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

little-river-49422

02/06/2019, 6:11 PM
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

white-balloon-205

02/06/2019, 6:27 PM
Those are in a
template
section which is used when templates are installed via
pulumi new
, or via
New Project
in the Pulumi console.