limited-rainbow-51650
03/11/2021, 7:46 PMConfigMap
type in:
// SetAllConfig sets all values in the provided config map.
func (s *Stack) SetAllConfig(ctx context.Context, config ConfigMap) error {
return s.Workspace().SetAllConfig(ctx, s.Name(), config)
}
support Pulumi structured configuration? It doesn’t look like it.red-match-15116
03/11/2021, 7:50 PMlimited-rainbow-51650
03/11/2021, 7:56 PMred-match-15116
03/11/2021, 7:57 PMI guess I’m missing something about your suggestion. Do you have a small code snippet to expand on your thinking?I think the issue I linked might be helpful to understand what goes on, but essentially to set a map you would have to set the top-level config key
s.Workspace().SetConfig(ctx, s.Name, "myTopLevelKey", ConfigValue{Value: "{'inner': 'foo', 'another': 'bar}", Secret: false})
To get that config, you would have to get the top-level config:
s.Workspace().GetConfig(ctx, s.Name, "myTopLevelKey")
And then Unmarshal the resulting json string into a struct and then access the inner keys.limited-rainbow-51650
03/11/2021, 8:08 PMConfigMap
at the right depth of my struct type so unmarshalling would be based on the ConfigMap
type. But I guess I will have to intercept with a custom JSON marshaller.params
I receive, would be additional stack config I would pass as-is via stack.SetAllConfig
. At least, that was my intent.red-match-15116
03/11/2021, 8:19 PMbored-oyster-3147
03/18/2021, 1:05 PM