pulumi / pulumi-digitalocean

A DigitalOcean Pulumi resource package, providing multi-language access to DigitalOcean
Apache License 2.0
83 stars 13 forks source link

V5 Major Version Release: Normalize input `dropletId` to the same type as `id` #600

Open iwahbe opened 10 months ago

iwahbe commented 10 months ago

The upstream provider models id and dropletId as an integer. Pulumi always models id as a string, which works well for most providers... but not this one. For the next major version release of this provider, we should switch over to modeling dropletId as a string, allowing the convenient passing of a droplet's id field to a input that accepts a dropletId.

The current workaround is to parse the id field before passing it into dropletId:

new digitalocean.ReservedIp("vpnReservedIp", {
  dropletId: vpnDroplet.id.apply(parseInt(id),
  region: vpnDroplet.region,
});

This will fix:

iwahbe commented 10 months ago

If you feel that this issue is sufficiently painful to motivate a major version bump all on it's own, please 👍 this comment.

If you feel that this issue should not motivate a major version bump, please 👎 this comment.

nmathew98 commented 4 weeks ago

@iwahbe can we update the docs

iwahbe commented 5 days ago

@nmathew98 Which docs?

nmathew98 commented 5 days ago

like here for golang: https://www.pulumi.com/registry/packages/digitalocean/api-docs/reservedip/

Image

and I think the rest are also referencing ID directly when it should be cast, like: https://www.pulumi.com/registry/packages/digitalocean/api-docs/floatingip/

Image

iwahbe commented 4 days ago

Those examples are generated, but I opened an issue in our code generator to track a fix. Thanks for pointing it out!