https://pulumi.com logo
Title
g

gifted-city-99717

04/28/2021, 6:35 PM
hi. I want to use a yaml config file to drive my pulumi automation. Is there a way to pass a list of strings to the stack? maybe something like stack.SetConfig(string, auto.ConfigValue) that I can use?
r

red-match-15116

04/28/2021, 6:42 PM
Yes, that is exactly the method you would use. Are you running into any issues doing so?
g

gifted-city-99717

04/29/2021, 10:24 AM
Yeah, I think I might be. Lists and maps don't seem to be mapping very well: eg: fmt.Sprintf("%s" , stringSlice) -> "[1.2.3.4/32]" which blows up. but it will work after quoting each element - same approach for a map[string]string too - iterating over each key,val pair and wrapping it in '{}'
b

bored-oyster-3147

04/29/2021, 4:00 PM
have you used
stack.SetAllConfig(...)
? it takes in a map of config you want to set.
g

gifted-city-99717

05/01/2021, 9:47 PM
I took a look ath
stack.SetAllConfig
but that requires an
auto.ConfigMap
- which is an alias to a
map[staring]auto.ConfigValue
.... which puts me in the same position - i still need to take maps and slices into account... but using json.Marshal handles it perfectly. Thanks for the help!