https://pulumi.com logo
Title
r

rough-window-15889

05/28/2021, 3:39 PM
Any advice on escaping “.” In the config set command? We’d like to end up with foo.bar.bar2.bar3: secure: encryptedval But we end up getting this when we use “.” anywhere in the passed in value foo: bar: bar2: bar3: secure: encryptedval
r

red-match-15116

05/28/2021, 4:23 PM
you’re getting this even when you don’t pass the
--path
flag?
r

rough-window-15889

06/01/2021, 3:41 PM
—path worked but our new issue is now the engineer that needs to run it will likely use power shell and power shell gets angry when we use bracket notation so for example pulumi config set-all --path --plaintext '["parent.name"].["nested.name"]'=value doesn’t work for use in power shell
r

red-match-15116

06/01/2021, 3:43 PM
Ah, I was answering the question about escaping the
.
- it sounds like you’re now asking about the reverse… i.e. setting a nested value within an object - is that right?
You can also pass in the json string of the object you are trying to nest i.e.
pulumi config set parent.name "{\"nested.name\": \"value\"}"
r

rough-window-15889

06/01/2021, 3:55 PM
Yeah we want a nested value inside an object Like example config:foo: Bar: value1 Bar2: value2 Bar3: value3
What you sent errors out saying it accepts between 1 and 2 arg but received 3
Not sure if it is escaping correctly in powershell
r

red-match-15116

06/01/2021, 4:07 PM
hmm… try
pulumi config set "parent.name" "{\"nested.name\": \"value\"}"
And you can probably avoid escaping the inner quotes by using single quotes on the outside
pulumi config set 'parent.name' '{"nested.name": "value"}'
r

rough-window-15889

06/01/2021, 4:17 PM
The end result for the last one was Config😛arent: name: ‘{nested.name: value}’ With the —path flag on
r

red-match-15116

06/01/2021, 4:17 PM
Yeah… don’t use the path flag
Because the way you are using it you don’t want it to be interpreted as a path in an object
r

rough-window-15889

06/01/2021, 4:18 PM
Without —path results with Config😛arent.name: ‘{nested.name: value}’
r

red-match-15116

06/01/2021, 4:19 PM
Isn’t that what you want?
r

rough-window-15889

06/01/2021, 4:20 PM
Is that functionally the same as config:foo: Bar: value1 Bar2: value2 Bar3: value3 Maybe I’m misunderstanding. These will be secrets too so ultimately it will be secure values inside too.
We only need this for like 6 or so values and we wanted to make it easier on another engineer to script it out in powershell for them but we may just have them set the values and we go back in and manually manipulate the yaml file.
Thank you for the help you’ve provided 😊
👍🏽 1