Is there a way to specify type when setting stack ...
# general
p
Is there a way to specify type when setting stack config value? Or at least enforce consistency. Consider these two commands:
Copy code
pulumi config set --path 'foo["bar"]' 100
pulumi -C infra/ config set 'baz' 100
These result in this stack config:
Copy code
test:baz: "100"
test:foo:
  bar: 100
i.e. it's a string value for top-level key while it's number for nested key.
b
this looks like a bug, it should set the value correctly each time. could you open an issue?
p
This is what I found in the documentation for
get_object()
Python method (https://www.pulumi.com/docs/reference/pkg/python/pulumi/#pulumi.Config.get_object):
This routine simply JSON parses and doesn’t validate the shape of the contents.
while for
get()
method (https://www.pulumi.com/docs/reference/pkg/python/pulumi/#pulumi.Config.get) it explicitly returns `str`:
get(key: str) → Optional[str]
I guess the same or similar logic applies for the Pulumi CLI. Considering the docs, I initially thought it's awkward but desired behavior. Anyway I'll open an issue 👍.