https://pulumi.com logo
Title
h

high-translator-37096

12/09/2022, 8:37 AM
Howdy! I'm trying to find a way to set a list of strings for a key via the pulumi/actions
config-map
property. I tried to set it with:
"some-key":{"value":["some-value-a","some-value-b"]}
which leads to a comma-separated string
some-value-a,some-value-b
in the Pulumi.stack.yaml. I also tried to send:
{"some-other-key":[{"value":"some-other-value-a"},{"value":"some-other-value-b"}]}
which leads to a string
undefined
in the Pulumi.stack.yaml. What I would like to see is:
<pulumi-project>:some-key:
  - some-value-a
  - some-value-b
This could be defined via cli with
pulumi config set --path "some-key[0]" "some-value-a"
but how do you do it via automation api?
w

worried-rain-74420

12/09/2022, 3:48 PM
Hello!
how do you do it via automation api?
Are you trying to use Automation API or the GitHub Action? Here's a recent explanation of how to use
config-map
in the action. It's a relatively new feature; we need to improve its documentation for sure.
h

high-translator-37096

12/09/2022, 6:04 PM
We use the Github Action, yes. But the Github Actions internally uses the Automation API afaik. The explanation shows how to use a string, how about a list of strings?
w

worried-rain-74420

12/09/2022, 6:06 PM
I would expect a list of strings to use YAML list notation:
config-map: "{env: {value: dev, secret: false}, my-app:releasetag: { value: ["hello", "world"], secret: false}}"
I could be wrong tbh 🤷‍♂️
h

high-translator-37096

12/09/2022, 6:07 PM
I tried to set it with: "some-key":{"value":["some-value-a","some-value-b"]} which leads to a comma-separated string some-value-a,some-value-b in the Pulumi.stack.yaml.
w

worried-rain-74420

12/09/2022, 6:07 PM
Ah, hm, could you try single quotes?
Within the array
Possible you need whitespace around the list too.
h

high-translator-37096

12/09/2022, 6:09 PM
I would guess single ticks, will not help, but I can try
Single ticks even break the JSON
w

worried-rain-74420

12/13/2022, 3:50 PM
Damn. Could you open an issue? Sorry for the difficulty here.
h

high-translator-37096

12/14/2022, 7:40 AM
w

worried-rain-74420

12/14/2022, 4:08 PM
Thank you!
h

high-translator-37096

12/20/2022, 11:50 PM
There's an update, which is quite interesting: https://github.com/pulumi/pulumi/issues/11649#issuecomment-1360443505