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

Can't set a default value for a component input of type integer #764

Open
Tracked by #15939
mikhailshilkov opened this issue Mar 21, 2025 · 0 comments
Open
Tracked by #15939
Assignees
Labels
area/component-packages kind/bug Some behavior is incorrect or out of spec

Comments

@mikhailshilkov
Copy link
Member

What happened?

I want to set a default value for an integer input in a YAML component. I have

      rsaBits:
        type: integer
        default: 2048

failing with

yaml-components:index:SelfSignedCertificate resource 'mycert' has a problem: PulumiPlugin.yaml:18,7-14: type mismatch: default value of type number but type integer was specified;

changing to type: number fails with unknown type: number.

Example

runtime: yaml
name: yaml-components
components:
  SelfSignedCertificate:
    inputs:
      algorithm:
        type: string
        default: RSA
      ecdsaCurve:
        type: string
        default: P224
      dnsName:
        type: string
      validityPeriodHours:
        type: integer
      localValidityPeriodHours:
        type: integer
      rsaBits:
        type: integer
        default: 2048
    resources:
      ca:
        type: tls:index/privateKey:PrivateKey
        properties:
          algorithm: ${algorithm}
          ecdsaCurve: ${ecdsaCurve}
          rsaBits: 2048
      caCert:
        type: tls:index/selfSignedCert:SelfSignedCert
        properties:
          privateKeyPem: ${ca.privateKeyPem}
          isCaCertificate: true
          validityPeriodHours: ${validityPeriodHours}
          subject:
            organization: Example Org
          allowedUses:
            - key_encipherment
            - digital_signature
        options:
          parent: ${ca}
      privateKey:
        type: tls:index/privateKey:PrivateKey
        properties:
          algorithm: ${algorithm}
          ecdsaCurve: ${ecdsaCurve}
          rsaBits: 2048
        options:
          parent: ${ca}
      certRequest:
        type: tls:index/certRequest:CertRequest
        properties:
          privateKeyPem: ${privateKey.privateKeyPem}
          dnsNames:
            - ${dnsName}
          subject:
            organization: Example Org
            commonName: ${dnsName}
        options:
          parent: ${privateKey}
      cert:
        type: tls:index/locallySignedCert:LocallySignedCert
        properties:
          certRequestPem: ${certRequest.certRequestPem}
          caPrivateKeyPem: ${ca.privateKeyPem}
          caCertPem: ${caCert.certPem}
          validityPeriodHours: ${localValidityPeriodHours}
          allowedUses:
            - key_encipherment
            - digital_signature
        options:
          parent: ${certRequest}
    outputs:
      pem: ${cert.certPem}
      privateKey: ${privateKey.privateKeyPem}
      caCert: ${caCert.certPem}
name: cert-component-yaml
runtime: yaml
packages:
  yaml-components: ../
resources:
  mycert:
    type: yaml-components:SelfSignedCertificate
    properties:
      dnsName: example.com
      validityPeriodHours: 24
      localValidityPeriodHours: 24
outputs:
  pem: ${mycert.pem}
  privateKey: ${mycert.privateKey}
  caCert: ${mycert.caCert}

Output of pulumi about

3.157.0

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

@mikhailshilkov mikhailshilkov added area/component-packages kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Mar 21, 2025
@lunaris lunaris removed the needs-triage Needs attention from the triage team label Mar 21, 2025
@tgummerer tgummerer self-assigned this Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/component-packages kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants