Hi, have a basic question: how do I add an item to...
# getting-started
Hi, have a basic question: how do I add an item to a list in the config using the CLI? I tried
pulumi config set aws:allowedAccountIds [0000000]
but I get an error of “zsh: no matches found: [000000]”
pulumi config set aws:allowedAccountIds 000000
works but adds it as a value.
I think you have to add the entire list in one go, in JSON notation? Else edit the YAML file directly.
Actually, I've never tried anything like
pulumi config set aws:allowedAccountIds[0] xyz
... might be worth a shot?
I tried indexing it as well but that doesn't work
Ah, indexing is the way to go, but you need to add the
option to tell it that there's an index in the key.
Copy code
pulumi config set --path 'delete[0]' me
👍 2
From `pulumi config set --help`:
-h, --help help for set
--path The key contains a path to a property in a map or list to set
--plaintext Save the value as plaintext (unencrypted)
--secret Encrypt the value instead of storing it in plaintext
Ways of working, eh? I've never used
pulumi config set
, I always edit the file...
Ahhhh!! I had tried the
flag and it didn't work. I noticed your quotes
around the index just now, and lo and behold…it worked. Haha thanks!
👍 1
Yes, need single quotes to ensure sh/bash doesn't parse
Or you can liberally sprinkle `\`s...
Yeah, the error makes sense now. Thanks!