pulumi-eks icon indicating copy to clipboard operation
pulumi-eks copied to clipboard

Include install-pulumi-plugin.js in @pulumi/eks package

Open justinvp opened this issue 5 years ago • 3 comments

With https://github.com/pulumi/pulumi-eks/pull/458, the @pulumi/eks package will require the eks plugin to be installed. The package.json has been annotated with "pulumi": { "resource": true } so the plugin will get installed as part of the GetRequiredPlugins search, but we should also include the standard install-pulumi-plugin.js script we do for our other providers, which will install the plugin when the package is installed.

Note that there is a bit of a chicken and egg problem... Installing the eks plugin will install the @pulumi/eks package (via npm install during plugin install), and then installing @pulumi/eks would be running pulumi plugin install resource eks..., so would need to make sure we don't loop doing this over and over.

It may be that we decide to not make use of install-pulumi-plugin.js for the EKS package for now.

justinvp avatar Nov 22 '20 05:11 justinvp

Does this have to be done manually in every package, or can/will this be automatically generated by package codegen?

lukehoban avatar Jan 06 '22 20:01 lukehoban

Does this have to be done manually in every package, or can/will this be automatically generated by package codegen?

We were just discussing this in Slack yesterday, where I brought up that we may want to do this in codegen. I'll point you to the thread. The alternative is to do it in the GHA workflow as part of publishing the package (it'll inject the install script and update package.json before publishing the package). If we're using the latter approach, we'll need to update our script to support specifying the --server flag to pulumi plugin install if the package.json has a custom server specified for the plugin.

justinvp avatar Jan 06 '22 20:01 justinvp

I've opened https://github.com/pulumi/pulumi/issues/8701 to track considering doing this in the Node.js SDK codegen.

justinvp avatar Jan 06 '22 22:01 justinvp