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

DigitalOcean volume attachment requires dropletId as number but dropletId is string #351

Open
Dreamystify opened this issue Dec 13, 2022 · 1 comment
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@Dreamystify
Copy link

What happened?

The following example in the docs

const foobarVolume = new digitalocean.Volume("foobarVolume", {
    region: "nyc1",
    size: 100,
    initialFilesystemType: "ext4",
    description: "an example volume",
});
const foobarDroplet = new digitalocean.Droplet("foobarDroplet", {
    size: "s-1vcpu-1gb",
    image: "ubuntu-18-04-x64",
    region: "nyc1",
});
const foobarVolumeAttachment = new digitalocean.VolumeAttachment("foobarVolumeAttachment", {
    dropletId: foobarDroplet.id, <--- this errors
    volumeId: foobarVolume.id,
});

Errors with the following

Type 'Output<string>' is not assignable to type 'Input<number>'.
  Type 'Output<string>' is not assignable to type 'OutputInstance<number>'.
    Types of property 'apply' are incompatible.
      Type '{ <U>(func: (t: string) => Promise<U>): Output<U>; <U>(func: (t: string) => OutputInstance<U>): Output<U>; <U>(func: (t: string) => U): Output<...>; }' is not assignable to type '{ <U>(func: (t: number) => Promise<U>): Output<U>; <U>(func: (t: number) => OutputInstance<U>): Output<U>; <U>(func: (t: number) => U): Output<...>; }'.
        Types of parameters 'func' and 'func' are incompatible.
          Types of parameters 't' and 't' are incompatible.

Pulumi Version: v3.49.0

Steps to reproduce

Run the example from the typescript docs
https://www.pulumi.com/registry/packages/digitalocean/api-docs/volume/

Expected Behavior

dropletId to be the same type

Actual Behavior

VolumeAttachment.dropletId Input
Droplet.dropletId Output

Output of pulumi about

No response

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

@Dreamystify Dreamystify added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Dec 13, 2022
@AaronFriel AaronFriel transferred this issue from pulumi/pulumi Dec 14, 2022
@squaremo squaremo removed the needs-triage Needs attention from the triage team label Dec 16, 2022
@squaremo
Copy link

Ah yes, I can see from the API docs https://www.pulumi.com/registry/packages/digitalocean/api-docs/droplet/#id_nodejs is typed string, and https://www.pulumi.com/registry/packages/digitalocean/api-docs/volumeattachment/#dropletid_nodejs is typed number.

As a workaround, can you use Apply to parse a number from the string, and use that as dropletId?

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

No branches or pull requests

1 participant