sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.07k stars 118 forks source link

Cannot link dynamic pulumi resources #486

Closed ian-pascoe closed 3 weeks ago

ian-pascoe commented 4 weeks ago

I am trying to link custom dynamic resources from pulumi. I have used the following code to try to link my database URLs from Neon:

sst.Link.makeLinkable(NeonBranch, function () {
      return {
        properties: {
          readOnlyUrl: this.readOnlyUrl,
          readWriteUrl: this.readWriteUrl,
        },
      };
 });

But the only thing to show in my types.generated.ts file is the following:

NeonBranch: {
    type: "pulumi-nodejs.dynamic/theaistudybible.NeonBranch"
}

I have followed all rules for adding outputs for dynamic resources outlined here: https://www.pulumi.com/docs/concepts/resources/dynamic-providers/#dynamic-resource-outputs

Ernxst commented 4 weeks ago

Commenting because I ran into this recently - the pulumi docs aren't entirely correct (see this issue), you're supposed to prefix the property declarations in the dynamic resource class with declare

ian-pascoe commented 4 weeks ago

Commenting because I ran into this recently - the pulumi docs aren't entirely correct (see this issue), you're supposed to prefix the property declarations in the dynamic resource class with declare

This did fix the problem! Thank you

jayair commented 4 weeks ago

Can this be closed?

ian-pascoe commented 4 weeks ago

Yes, issue is filed with pulumi and my code is working now, thanks!