Hi All. I am working on bridging a Terraform provi...
# pulumiverse
a
Hi All. I am working on bridging a Terraform provider I’ve built into pulumi, and I intent to put that in the registry once it is ready. I have few questions regarding the boilerplate refactoring that are not super clear to me. 1. In the
provider/resources.go
In the Golang section below, I see the url pointing to the pulumi repository instead of the provider repo. Which one is correct?
Copy code
Golang: &tfbridge.GolangInfo{
			ImportBasePath: filepath.Join(
				fmt.Sprintf("<http://github.com/pulumi/pulumi-%[1]s/sdk/|github.com/pulumi/pulumi-%[1]s/sdk/>", mainPkg),
				tfbridge.GetModuleMajorVersion(version.Version),
				"go",
				mainPkg,
			),
			GenerateResourceContainerTypes: true,
2. In
provider/cmd/pulumi-resource-foo/main.go
it also points to a pulumi repository i.e zpa “http://github.com/pulumi/pulumi-xyz/provider” Should the repository still point to pulumi instead? Looking at other providers, they all point to pulumi instead of their own repo as specified in the boilerplate.
b
@acoustic-tiger-77630 no, it should point to your github org/repo
if you look at the providers in github.com/pulumiverse they are good examples
a
Hi @billowy-army-68599 Thank you. Here is an example of what I am referring to. The imports are pointing to the pulumi directory instead. Is this done automatically once the provider is placed in the registry?
b
sorry I’m not really following I’m afraid, what do you mean?
a
These are screenshots from i.e the Cloudflare provider, which lives under the pulumi registry repo. Looking at the main.go screenshot, they are importing their pulumi provider from the pulumi repo instead i.e cloudflare “github.com/pulumi-cloudflare/provider/v4
In other words, why is cloudflare pointing to the pulumi registry instead of their repo org?
b
the provider module path is this: https://github.com/pulumi/pulumi-cloudflare/blob/master/provider/go.mod#L1 So the import references that
the provider go.mod is different from the SDK go.mod which is used in the registry
a
Got it, so once I submit the pull request under the registry that will have to be changed essentially. Am understanding it correct?
b
you should set the go.mod to whatever you repo path is, for example: https://github.com/pulumiverse/pulumi-scaleway/blob/master/provider/go.mod#L1 Here is my go.mod for my provider https://github.com/pulumiverse/pulumi-scaleway/blob/master/sdk/go.mod#L1 Notice, it’s the same as where my repo lives.
which again, is the same as my repo path
the registry doesn’t care at all about the paths
a
Got it. It just seems weird to me that all providers in the registry are pointing to the pulumi repo instead of their own repo, so it made me think that it had to be changed in order to submit to the registry via PR.
b
you keep saying “own repo” which I’m not understanding
there is only one repo per provider, so struggling to get my head around that
a
Let me change the question because I am also confused maybe. Are all the providers under the pulumi registry i.e cloudflare, f5, auth0, docker etc, created by Pulumi themselves or by the respective vendors?
b
they are managed and maintained by Pulumi.
there are a few in github.com/pulumiverse that are managed by trhe community, including myself
a
Ok… that explain now… I thought that all those providers were created and maintained by the vendors themselves, which is not the case; hence the reason I thought that once I finished developing the provider, I had to change the paths to be the pulumi registry instead. That is explained now. It makes sense.
👍 1
Thank you for your help understanding that. Much appreciated 🙂
b
let me know if you need help with bridging your providers
a
Absolutely. Thank you again 🙂