When building your own provider, what's the link b...
# general
c
When building your own provider, what's the link between the Provider and the SDK? More explicitly, when I run a pulumi action (e.g.
pulumi preview
). Pulumi knows to download and install the appropriate provider for the SDKs i'm using in my Pulumi project.
l
A lot of Pulumi is centered around the Pulumi schema of a provider. Within the schema, you have the
pluginDownloadURL
containing the storage location of the provider binary. Every SDK has the schema bundled, which is how it can find out about the location. For some of the SDK packages, we have package dependent hooks which downloads this provider binary during the package install. E.g. for JS/TS NPM packages, we consistently have an
install
script: https://github.com/pulumi/pulumi-azure-native/blob/master/sdk/nodejs/package.json#L16
c
@limited-rainbow-51650 how would I for example test my plugin locally?
l
If you have built the provider binary locally, and it is named
pulumi-resource-<yourname>
, then make sure it is on your
PATH
and you should be good to go to test locally.
👍 1
If you started your provider development from one of our template repos, the build setup should create the binary in the
./bin
folder of your project.
🙏 1
c
Thanks @limited-rainbow-51650
I'm running into an issue
Copy code
Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="Invalid character(s) found in major number "sample-provider\\n0"")
l
Is this when running locally? Are you bridging an existing TF provider or are you developing a native one?
c
I'm developing a native one
l
Did you bootstrap from this template? https://github.com/pulumi/pulumi-provider-boilerplate
c
I didn't, no. I've just been cobbling pieces together based on the pulumi providers i've seen. Taking some inspiration from the pulumi aws native provider.
It is when running locally, yes
The version file looks like this
Copy code
sample-provider\n0.0.0+dirty
l
We are aware we have to make this whole provider development much more simple. Is it an option to restart your effort using the boilerplate repo, initialize it using these instructions, and then overlay your existing code on top of it?
c
I can do that.
I resolved the issue though
🎊 1
I'll provide feedback as I go along if that's ok
l
Please do! We want to know what are the hurdles you run into.
I don’t have much time today anymore to follow up on this, but ping me tomorrow if you would like to review your setup in case of problems.
c
Thank you kindly! Will do
l
Good luck! And curious what you are building… 😉
c
At the moment, it's a POC for an provider to be used internally
l
Nice to hear you leverage the provider development path to manage internal APIs! 🎉