I am trying to build a provider for opsgenie using...
# general
I am trying to build a provider for opsgenie using the https://github.com/pulumi/pulumi-tf-provider-boilerplate, but I keep getting this error
Copy code
scripts/get-py-version.go:7:2: cannot find module providing package <http://github.com/pulumi/pulumi/sdk/v2/go/common/util/buildutil|github.com/pulumi/pulumi/sdk/v2/go/common/util/buildutil>: working directory is not part of a module
opsgenie Package
cd provider && go install -ldflags "-X <http://github.com/pulumi/pulumi-opsgenie/provider/pkg/version.Version=v0.0.1-alpha.1588074230+gca4ea26.dirty|github.com/pulumi/pulumi-opsgenie/provider/pkg/version.Version=v0.0.1-alpha.1588074230+gca4ea26.dirty>" <http://github.com/pulumi/pulumi-opsgenie/provider/cmd/pulumi-tfgen-opsgenie|github.com/pulumi/pulumi-opsgenie/provider/cmd/pulumi-tfgen-opsgenie>
pulumi-tfgen-opsgenie schema --out ./provider/cmd/pulumi-resource-opsgenie
/bin/bash: pulumi-tfgen-opsgenie: command not found
make: *** [generate_schema] Error 127
Any idea on what I might be doing wrong?
do you have a
file in the
I am following the directions in the pulumi-tf-provider-boilerplate readme. I did notice this package does not exist in the
folder`github.com/pulumi/pulumi/sdk/v2/go/common/util/buildutil`. So that explains why when I run
it complains about not being able to find it.. but not sure why its not there. I've only dabbled in go, so i'm no expert on what might be happening there
This is what I see in the vendor folder for pulumi. I should see a
folder in the
@billowy-army-68599 can you help @gray-yak-9058 here?
sure! @gray-yak-9058 do you have this checked in anywhere I can have a look?
also, which version go are you using?
ah, I see the option, you need to add
to your
I think that the opsgenie TF provider may not be upgraded to the sdk @billowy-army-68599
that's possible too, but currently this is failing to execute
pulumi-tfgen-opsgenie schema --out ./provider/cmd/pulumi-resource-opsgenie
it's doing a
go install
but can't resolve
@gray-yak-9058 can you double check by running
which pulumi-tfgen-opsgenie
I don't have this checked in anywhere. I have version 1.14.1 of go installed. I am getting
pulumi-tfgen-opsgenie not found
when running that command
so the
is doing two things, first it's installing your tfgen command like so
Copy code
cd provider && go install -ldflags "-X <http://github.com/pulumi/pulumi-opsgenie/provider/pkg/version.Version=v0.0.1-alpha.1588074230+gca4ea26.dirty|github.com/pulumi/pulumi-opsgenie/provider/pkg/version.Version=v0.0.1-alpha.1588074230+gca4ea26.dirty>" <http://github.com/pulumi/pulumi-opsgenie/provider/cmd/pulumi-tfgen-opsgenie|github.com/pulumi/pulumi-opsgenie/provider/cmd/pulumi-tfgen-opsgenie>
this install the tfgen binary to
so you'll need to add this to
, try doing
I'm on a call at the moment, but if you like I can get on a zoom with you in about an hour to help you through this
I think it worked, though it did blow up on the dotnet SDK as I have dotnet core 3.1 installed, but that's ok for now
I actually have a meeting I need to get ready for soon as well. I think my last question would be, what do I need to do on this step in the readme https://github.com/pulumi/pulumi-tf-provider-boilerplate#build-the-provider. It looks like the provider was built, but not seeing any opsgenie resources
I guess the question is, what do I need to do in
I think I see after reading through that file. I updated the
property to
Copy code
Resources: map[string]*tfbridge.ResourceInfo{
			"opsgenie_user": {Tok: makeResource(mainMod, "User")},
and after running
again it looks like I have a
resource now
Awesome. Thanks for that. And thanks again for the help with getting the sdk's built @billowy-army-68599 @broad-dog-22463
we are looking to make this easier, so thanks for the feedback!
@gray-yak-9058 let us know if you need any more information or help!!
@billowy-army-68599 I think the template may be out of sync with the world after modules if the instructions include vendoring.
the instructions shouldn't, I do have a work item to get the docs up to speed
Hey @billowy-army-68599 @broad-dog-22463 sorry to revive an old thread, but I have another issue related to this now. I built the pulumi-opsgenie SDKs and pushed it up into my github repo (https://github.com/jacobscunn07/pulumi-opsgenie), but now when I attempt to use this provider I get an error
Copy code
➜ pulumi preview
Previewing update (dev):
     Type                          Name            Plan       Info
 +   pulumi:pulumi:Stack           my-project-dev  create
     └─ pulumi:providers:opsgenie  opsgenie                   1 error

  pulumi:providers:opsgenie (opsgenie):
    error: no resource plugin 'opsgenie' found in the workspace or on your $PATH
Doing a quick google and I came across this github issue, would this be the fix for me? If so, I guess I need to version my opsgenie provider 🤔 https://github.com/pulumi/pulumi/issues/2571
if you build this locally, it will go on your GOPATH
then Pulumi should find it if GOPATH is part of PATH
otherwise you will need to publish a version of the plugin and have pulumi install it
Ideally, I wouldn't be building the provider and running pulumi up together during CICD.. so it sounds like I need to version it
this is in my go.mod
Copy code
module my-project

go 1.13

require (
	<http://github.com/jacobscunn07/pulumi-opsgenie/sdk|github.com/jacobscunn07/pulumi-opsgenie/sdk> v0.0.0-20200505144548-ecdf0538b17f
	<http://github.com/pulumi/pulumi/sdk/v2|github.com/pulumi/pulumi/sdk/v2> v2.0.0
not sure how that version was found/named, but this isn't enough to get it going if there are no tags in github currently?
hmm I needed to run it like this
PATH=$PATH:$GOPATH/bin pulumi preview
and the preview completed without error. I'm still fairly new to golang, so not quite sure why
needs to be in
yeah sorry this isn't a bit more documented - I promise we are looking at this atm 😕
Thanks for taking the time to respond so quickly and help me with this. Yeah, updating docs would definitely help! I was able to create an opsgenie user. It was the only resource I included to be converted as a quick test. I think I should be good to go now on including the other opsgenie resources and versioning the provider
We are also going to write docs on how to use Github Releases to host your plugin 🙂
and the required GitHub Actions to do it