https://pulumi.com logo
#yaml
Title
# yaml
g

gifted-gigabyte-53859

11/14/2023, 8:10 AM
A 4th question: pulumi is converting all stack config values to strings. I want to store a boolean type there. Is there a way to store a value as a boolean, or to convert a string to a bool? I tried forcing it but didn't work
Copy code
# Pulumi.develop.yaml
config:
  myproject:myvar: false

# Pulumi.yaml

resources:
  myresource:
    options:
      protect: ${pulumi.stack}.${myvar}
    properties:
      ...
The above gives an error
Copy code
error: failed to discover plugin requirements: 
-error: Pulumi.yaml:71,16-42: protect must be a boolean value;
If I try to force it:
Copy code
options:
      protect: !!bool ${pulumi.stack}.${myvar}
It doesn't work:
Copy code
error: could not unmarshal '.../Pulumi.yaml': invalid YAML file: yaml: cannot decode !!str `${pulumi.stack}.${protect_dynamodb_tables}` as a !!bool
I also tried passing it through the
variables:
section in
Pulumi.yaml
Copy code
# Pulumi.yaml
...
variables:
  varProtectTablesAsBool:
    type: bool
    value: ${pulumi.stack}.${protect_dynamodb_tables} # tried both with !!bool and without
Still doesn't work, giving the first error
protect must be a boolean value;
e

echoing-dinner-19531

11/15/2023, 8:28 AM
I think there's some bugs around this at the moment, we've got people looking into it.
4 Views