https://pulumi.com logo
Title
p

plain-quill-22197

07/05/2021, 4:39 PM
However, I struggle to understand: ā€¢ how to test it locally? the CLI seems to require the provider need to be published in some package registry ā€¢ how to add it to the Pulumi org? I found no guidelines for contributing new providers, except an issue in the bolierplate repo, which is open for a year
f

fierce-ability-58936

07/05/2021, 10:24 PM
you can run
pulumi plugin install
with
-f, --file string     Install a plugin from a tarball file, instead of downloading it
You don't have to add it to Pulumi org. Can just publish it in your org and use https://github.com/springload/pulumi-tf-provider-ec/blob/master/provider/resources.go#L175 That makes it generate SDKs that reference this URL instead of the default one.
Documentation is a bit hairy here, sometimes you have go through the code and github issues.
b

broad-dog-22463

07/06/2021, 11:03 AM
@fierce-ability-58936 / @plain-quill-22197 please let us know what will help make this easier! Alexey, if you need to jump on a call, I can take you through the process
p

plain-quill-22197

07/06/2021, 11:09 AM
@fierce-ability-58936 thanks, it's very helpful
@broad-dog-22463 maybe following up on this issue would be helpful for people building Pulumi providers https://github.com/pulumi/pulumi-tf-provider-boilerplate/issues/28
b

broad-dog-22463

07/06/2021, 11:13 AM
totally agree - but what specifically would help - "docs" is a broad subject as we both know šŸ™‚ What were the serious pain points for you that you had blocking on etc - I've built 50 of these and each are different due to upstream dependencies etc so trying to get an understanding of what the main issues are and then we can at least add value for our community sooner
p

plain-quill-22197

07/06/2021, 11:36 AM
things like
Development

Do this, that, add PluginDownloadURL to resources.go
Use make development
Just skimmed through the makefile, found it
development:: install_plugins provider lint_provider build_sdks install_sdks cleanup # Build the provider & SDKs for a development environment
b

billowy-army-68599

07/06/2021, 2:28 PM
@plain-quill-22197 there's a full example of a community provider here: github.com/jaxxstorm/pulumi-rke
p

plain-quill-22197

07/06/2021, 2:37 PM
šŸ‘
thanks
I already made my work and tested it šŸ™‚ still need to adopt the small bits
b

billowy-army-68599

07/06/2021, 2:40 PM
happy to hear it!
p

plain-quill-22197

07/06/2021, 4:05 PM
@billowy-army-68599 have you been able to instruct Pulumi CLI to download your provider when using the .NET stack? I see the download location is specified for all langs except .NET
b

billowy-army-68599

07/06/2021, 5:10 PM
no, you have to do it manually with
pulumi plugin install --server
for the time being
the problem with Go and Dotnet is that the packaging system doesn't allow metadata like node and python do
p

plain-quill-22197

07/07/2021, 6:25 PM
thanks, I thought so
for .NET though I think it could be a custom build target
b

billowy-army-68599

07/07/2021, 6:35 PM
can you elaborate? I'm open to any suggestions here to get this fixed
p

plain-quill-22197

07/08/2021, 12:42 PM
For example, this code added to the csproj file runs
yarn install
when the project builds
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
        <Exec Command="node --version" ContinueOnError="true">
            <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
        </Exec>
        <Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project." />
        <Message Importance="high" Text="Restoring dependencies using 'yarn'. This may take several minutes..." />
        <Exec WorkingDirectory="$(SpaRoot)" Command="yarn install" />
    </Target>
it's possible to include a custom target in a library package, so then the package gets installed, the target is included, like Adam Ralph did with MinVer https://github.com/adamralph/minver/blob/main/MinVer/MinVer.csproj