Is it possible in `Pulumi.yaml` for a project to d...
# typescript
b
Is it possible in
Pulumi.yaml
for a project to define the type of a config value, or a default value for a complex object value, for values which will be namespaced into a specific component resource? We've got a load of component resources that we want config for, and some of those names are common (but with different values) that'll end up clashing, so rather than config named as
project:resource1ParameterA
,
project:resource2ParameterA
I'd much rather define them as
resource1:parameterA
and
resource2:parameterA
. But if I do that and try to specify a
type
or
default
, I get the error
Configuration key is not namespaced by the project and should not define a [type|default value]
. If I try and have multiple levels of namespace, like
project:resource1:parameterA
, I get
invalid configuration key
. So is it just not possible to describe in the config the value 'shape'', and then validate against that on
pulumi set
, if they're namespaced into a component resource?
l
You can set up separate config blocks to do this. The yaml will look as you suggest. To access the values, you use
resource2Config = new pulumi.Config('resource2');
.
However you cannot add typing. This is yaml 🙂