pulumi / pulumi-yaml

YAML language provider for Pulumi
Apache License 2.0
38 stars 11 forks source link

Reference to a boolean config value is converted to a string when used #495

Closed nstires-ctgx closed 11 months ago

nstires-ctgx commented 1 year ago

What happened?

When a config value is declared, and a default is passed, it's changing the type of the value to string.

On pulumi up:

warning: Failed to get information about the plugin: failed to discover plugin requirements:
-error: Pulumi.yaml: protect must be a boolean value;

Expected Behavior

Default value should be accepted and passed as bool.

Steps to reproduce

Pulumi.yaml:

config:
  protect:
    default: false
    type: boolean
resources:
  network:
    type: gcp:compute:Network
    options:
      protect: ${protect}

Note that:

Output of pulumi about

CLI
Version      3.78.1
Go Version   go1.20.7
Go Compiler  gc

Host
OS       ubuntu
Version  22.04
Arch     x86_64

This project is written in yaml

Additional context

No response

Contributing

Vote on this issue by adding a šŸ‘ reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

aureq commented 1 year ago

Could it be a regression or related to https://github.com/pulumi/pulumi-yaml/issues/298 ?

Zaid-Ajaj commented 1 year ago

Hello @nstires-ctgx thank you for filing the issue and for the detailed report šŸ™ this is definitely a bug. protect should accept dynamic values regardless of where they come from (unless they are unknowns). We will fix this as soon as possible

AaronFriel commented 1 year ago

@Zaid-Ajaj - I'm fairly sure protect cannot accept dynamic values that are Outputs, but config keys are definitely acceptable.