Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: azure-native:dbforpostgresql:Server resource 'postgresServer' has a problem: 'version' should be of type 'string' but got a number #577

Open
pyousefi opened this issue May 9, 2024 · 1 comment
Labels
area/config kind/bug Some behavior is incorrect or out of spec

Comments

@pyousefi
Copy link

pyousefi commented May 9, 2024

What happened?

Deploying a postgresql server where the version number is in a config variable as a string (in quotes) is being returned as a number.

Example

Pulumi.dev.yaml:

config:
  storageSizeGB: 512
  version: '14' | "14" 

Pulumi.yaml:
version: ${version}

Output of pulumi about

CLI
Version 3.115.2
Go Version go1.22.2
Go Compiler gc

Plugins
KIND NAME VERSION
language yaml unknown

Host
OS Microsoft Windows 10 Pro
Version 10.0.19045 Build 19045
Arch x86_64

This project is written in yaml

Current Stack: bookerdimaio/pu-yaml-az-postgres/dev

TYPE URN
pulumi:pulumi:Stack urn:pulumi:dev::pu-yaml-az-postgres::pulumi:pulumi:Stack::pu-yaml-az-postgres-dev
pulumi:providers:azure-native urn:pulumi:dev::pu-yaml-az-postgres::pulumi:providers:azure-native::default
azure-native:dbforpostgresql:Server urn:pulumi:dev::pu-yaml-az-postgres::azure-native:dbforpostgresql:Server::postgresServer

Found no pending operations associated with dev

Backend
Name pulumi.com
URL https://app.pulumi.com/bookerdimaio
User bookerdimaio
Organizations bookerdimaio
Token type organization: bookerdimaio
Token type pouya-admin

No dependencies found

Pulumi locates its logs in C:\Users\pyous\AppData\Local\Temp by default

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).

@pyousefi pyousefi added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels May 9, 2024
@justinvp justinvp transferred this issue from pulumi/pulumi May 14, 2024
@justinvp justinvp added area/config and removed needs-triage Needs attention from the triage team labels May 14, 2024
@justinvp
Copy link
Member

Thanks for opening the issue and sorry for the trouble!

I was able to reproduce this with the following program and setting the config via pulumi config set version 14:

name: azurenativenum
runtime: yaml
resources:
  resourceGroup:
    type: azure-native:resources:ResourceGroup
  server:
    type: azure-native:dbforpostgresql:Server
    properties:
      resourceGroupName: ${resourceGroup.name}
      version: ${version}

In the meantime, you can workaround by passing the value through fn::toJSON which will cast the number to a string (e.g. fn::toJSON: ${version}):

name: azurenativenum
runtime: yaml
resources:
  resourceGroup:
    type: azure-native:resources:ResourceGroup
  server:
    type: azure-native:dbforpostgresql:Server
    properties:
      resourceGroupName: ${resourceGroup.name}
      version:
        fn::toJSON: ${version}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants