Any advice on escaping “.” In the config set comma...
# general
r
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
you’re getting this even when you don’t pass the
--path
flag?
r
—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
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.
Copy code
pulumi config set parent.name "{\"nested.name\": \"value\"}"
r
Yeah we want a nested value inside an object Like example configfoo 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
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
The end result for the last one was Configparent name: ‘{nested.name: value}’ With the —path flag on
r
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
Without —path results with Configparent.name ‘{nested.name: value}’
r
Isn’t that what you want?
r
Is that functionally the same as configfoo 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