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

rhythmic-camera-25993

01/14/2020, 4:53 PM
anyone know of any godaddy providers already available? if not I was going to take a stab at converting
terraform-godaddy
a bit later today
b

broad-dog-22463

01/14/2020, 4:58 PM
AFAICT, there isn't anything available today but please feel free to convert it and let me know if you need help
r

rhythmic-camera-25993

01/14/2020, 4:59 PM
thanks, will ping you if I run into issues 🙂
b

broad-dog-22463

01/14/2020, 4:59 PM
Not sure which TF provider you want to use for it?
r

rhythmic-camera-25993

01/14/2020, 4:59 PM
I need it to fully-automate my fargate service deploy for work so I'm pretty motivated. Was looking at this one: https://github.com/n3integration/terraform-godaddy
b

broad-dog-22463

01/14/2020, 4:59 PM
ok, so I can give you a few tips here
r

rhythmic-camera-25993

01/14/2020, 5:00 PM
was looking at this issue for main sets of pointers: https://github.com/pulumi/docs/issues/595
b

broad-dog-22463

01/14/2020, 5:00 PM
You can't really use https://github.com/pulumi/pulumi-tf-provider-boilerplate for this as this is an old provider that isn't migrated to the terraform-plugin-sdk
😥 1
I would suggest you look at the implementation of https://github.com/pulumi/pulumi-cloudamqp
it's not an impossible job btw - just needs to use the cloudamqp as an example
👍 1
(I need to make this process much smoother)
r

rhythmic-camera-25993

01/14/2020, 5:03 PM
this
stack72
person is all over this repo
😂 1
🤣
b

broad-dog-22463

01/14/2020, 5:05 PM
😉
hacker
r

rhythmic-camera-25993

01/14/2020, 5:06 PM
so where's
tfgen
com into this? is it a binary result of the
<https://github.com/pulumi/pulumi-terraform>
repo?
b

broad-dog-22463

01/14/2020, 5:07 PM
tfgen is a way of mapping the values in resources.go into our schema for the bridge between the 2 products
r

rhythmic-camera-25993

01/14/2020, 5:09 PM
so it's a proprietary thing? mostly wondering if I've got to mimic the
CustomResource
and
Provider
mappings I see in the
cloudamqp
mappings or if I can follow the 'gen most and customize via golang files' pattern
b

broad-dog-22463

01/14/2020, 5:09 PM
you need to follow the mapping in resources.go
👍 1
the key value pairs of TF resources to their Pulumi counterparts
r

rhythmic-camera-25993

01/14/2020, 5:11 PM
oh I see, resources.go is the definition file which is the main input into tfgen, then?
the makefile makes everything clear
b

broad-dog-22463

01/14/2020, 5:16 PM
yessir
r

rhythmic-camera-25993

01/14/2020, 6:23 PM
ok, I begin to see what you mean about the provider not supporting the new sdk style. So where I'm at is I've got my resources filled out, and the next step would be to build, however the type of the
provider
I'd be imported from the terrform-godaddy project is a different kind of schema than the one that the
tfbridge.ProviderInfo
is expecting. So there's not really a way to map across this, from what I'm seeing?
plus the go cli is yelling at me for trying to import a program rather than a library
here's current state (some paths modified to work for my repo, because naturally I don't have access to the pulumi org 🙂 )
I suppose I could make some helper types as part of this 'wrapper' that define the requisite provider and resources, then call into the
api
types provided by the terraform-godaddy library
b

broad-dog-22463

01/14/2020, 6:35 PM
I can have a look over this and see what's up with it
wait, did you use the pulumi-cloudamqp repo as a starting point here? It looks to me like this is pointing to the wrong deps in go.mod
it shouldn't have a dep on terraform-plugin-sdk
it should be terraform directly
r

rhythmic-camera-25993

01/14/2020, 6:36 PM
ah you meant using cloudamqp as a base
lemme try that then
I thought you meant using it as a 'model' more so than literal 'start with this code'
b

broad-dog-22463

01/14/2020, 6:38 PM
sorry, my bad - the cloudamqp has the correct deps to deal with a structure like that TF provider as it was built off an old provider
r

rhythmic-camera-25993

01/14/2020, 6:39 PM
cool, lemme hack around on this then
ok, re-did my defintions, imports, etc on top of the cloudamqp source code. I see two odd things: * when I run
make
, a reference is added to the pulumi-godaddy package to my
go.mod
file. This is the current package. This strikes me as odd. * when I run
make
, I get the import error about trying to import a program, not a library. This I think is a bug in the upstream library, because the provider is part of
package main
instead of
package godaddy
.
b

broad-dog-22463

01/14/2020, 7:09 PM
Ok can you push your code and I can look again?
r

rhythmic-camera-25993

01/14/2020, 7:16 PM
yeah, it's been updated
b

broad-dog-22463

01/14/2020, 7:38 PM
Just grabbing a bite then can look
r

rhythmic-camera-25993

01/15/2020, 3:48 PM
anything I can look into here to help?