https://pulumi.com logo
Title
w

worried-honey-61577

01/05/2021, 4:42 PM
Hey! Thank you guys for the work you do with Pulumi, I’m really enjoying working with it. I’m trying to generate a provider for Rundeck, and I had a question. I’m following this (the pulumi-tf-provider-boilerplate). I’m especially confused about the plugin (perhaps because publishing an NPM library on a private registry is something we do all the time. Moving forward with the plugin isn’t super clear). The
make build_sdks
command generates an npm library and a binary plugin. I can see the plugin:
$ pulumi plugin ls | grep rundeck
rundeck     resource  0.2.0                            40 MB   2 weeks ago    2 weeks ago
But now — how do I actually get this deployed somewhere so that it’s usable in a production environment? Here’s my fork of the
pulumi-tf-provider-boilerplate
, after having followed all the steps. Any ideas?
b

broad-dog-22463

01/05/2021, 4:45 PM
Hi @worried-honey-61577 I am looking at your provider right now
w

worried-honey-61577

01/05/2021, 4:46 PM
Thanks Paul!
b

broad-dog-22463

01/05/2021, 4:47 PM
so just to clarify you are fine with the npm publish part right?
w

worried-honey-61577

01/05/2021, 4:47 PM
Yep. It’s getting the library to install the plugin part that confuses me. Like where is the plugin deployed to? Is there some registry for it? How does the library know which plugins to install?
b

broad-dog-22463

01/05/2021, 4:48 PM
You could grab the build scripts that @billowy-army-68599 added to the pulumi-scaleway repo As you can see, that provider just pushes to the github package repo
pulumi plugin install resource scaleway --server-url https://github-package-location will be able to take the tar.gz created
@billowy-army-68599 we should probably record some videos on this to make this easier for people...
w

worried-honey-61577

01/05/2021, 5:00 PM
Mmmm ok that makes a bit more sense! Let me take a look at that Also I’m happy to be the guinea pig and help you guys write any documentation on this
I’m assuming you’re talking about this build script
So you upload it to some storage bucket, and then run
pulumi plugin install resource <name> --server-url <location-of-storage-bucket>
? How does that occur upon the installation of an NPM library, like if I were to
npm install @pulumi/gcp
b

billowy-army-68599

01/05/2021, 5:11 PM
hey, just catching up! my provider is here: https://github.com/jaxxstorm/pulumi-scaleway
w

worried-honey-61577

01/05/2021, 5:12 PM
Op, had the wrong build script 😅
b

billowy-army-68599

01/05/2021, 5:13 PM
so what happens is, when we build our SDKs, we inject this file: https://github.com/pulumi/scripts/blob/master/ci/install-pulumi-plugin.js into the packaged SDK, It doesn't happen inside the repo, it happens at build time
I never got round to implementing automatic plugin acquisition for scaleway and rke, but if you want to do it, you'll need to add
install-pulumi-plugin.js
with a
--server
option
w

worried-honey-61577

01/05/2021, 5:15 PM
Ok, that makes sense. What specific server is it? Is it storage bucket you self-host? I’ve seen this a few times now
<s3://rel.pulumi.com/releases/plugins/${PLUGIN_PACKAGE_NAME}>
b

billowy-army-68599

01/05/2021, 5:15 PM
you can probably remove a lot of this and do it in the make target with
jq
jq '.scripts.postinstall += "pulumi plugin install resource rundeck $(PROVIDER_VERSION) --server <https://bintray.com/pulumi-resource-rundeck>"' > package.json
I personally upload all my releases to bintray and then set this param https://github.com/jaxxstorm/pulumi-scaleway/blob/master/provider/resources.go#L84
<http://rel.pulumi.com|rel.pulumi.com>
is the default for pulumi owned plugins
w

worried-honey-61577

01/05/2021, 5:16 PM
Ahhhhh ok. Yeah we use Artifactory, so something private like that would be ideal for us
plus this
this’ll be fairly alpha-stage haha
b

billowy-army-68599

01/05/2021, 5:17 PM
you just need a http server to upload them to, artifactory would work, or just your own s3 bucket as well
w

worried-honey-61577

01/05/2021, 5:18 PM
Ok that’s awesome. Thank you guys so much! I’m sure I’ll be back with more questions later 🙂