https://pulumi.com logo
#general
Title
# general
c

colossal-vr-62639

07/28/2022, 8:29 AM
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

limited-rainbow-51650

07/28/2022, 8:33 AM
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

colossal-vr-62639

07/28/2022, 8:35 AM
@limited-rainbow-51650 how would I for example test my plugin locally?
l

limited-rainbow-51650

07/28/2022, 8:36 AM
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

colossal-vr-62639

07/28/2022, 8:38 AM
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

limited-rainbow-51650

07/28/2022, 8:43 AM
Is this when running locally? Are you bridging an existing TF provider or are you developing a native one?
c

colossal-vr-62639

07/28/2022, 8:44 AM
I'm developing a native one
l

limited-rainbow-51650

07/28/2022, 8:45 AM
Did you bootstrap from this template? https://github.com/pulumi/pulumi-provider-boilerplate
c

colossal-vr-62639

07/28/2022, 8:48 AM
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

limited-rainbow-51650

07/28/2022, 8:52 AM
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

colossal-vr-62639

07/28/2022, 8:52 AM
I can do that.
I resolved the issue though
🎊 1
I'll provide feedback as I go along if that's ok
l

limited-rainbow-51650

07/28/2022, 8:53 AM
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

colossal-vr-62639

07/28/2022, 8:54 AM
Thank you kindly! Will do
l

limited-rainbow-51650

07/28/2022, 8:54 AM
Good luck! And curious what you are building… 😉
c

colossal-vr-62639

07/28/2022, 8:55 AM
At the moment, it's a POC for an provider to be used internally
l

limited-rainbow-51650

07/28/2022, 8:59 AM
Nice to hear you leverage the provider development path to manage internal APIs! 🎉
2 Views