When using the Automation API, how can I pass conf...
# python
c
When using the Automation API, how can I pass configuration values that are not simple strings? According to the implementation it is not possible: https://github.com/pulumi/pulumi/blob/master/sdk/python/lib/pulumi/automation/_config.py#L29 🤔
According to the source code, pulumi.automation is just a wrapper around the command line tools. So I looked at how a list is handled in the config:
Copy code
$ yq '.config."gke-cluster:master-authorized-networks"' < Pulumi.dev.yaml
[
  "10.0.0.0/8"
]
$ pulumi config get gke-cluster:master-authorized-networks
["10.0.0.0/8"]
$ pulumi config get gke-cluster:master-authorized-networks --json
{
  "value": "[\"10.0.0.0/8\"]",
  "objectValue": [
    "10.0.0.0/8"
  ],
  "secret": false
}
Guess that explains why ConfigValue only takes strings. I need to JSON-serialize non-string values before calling it. Shouldn't we do this serialization transparently?