hi, i am trying to convert a tf provider to a new ...
# contribute
b
hi, i am trying to convert a tf provider to a new pulumi provider by
pulumi/pulumi-tf-provider-boilerplate
when
make build_sdks
, i have the following error:
Copy code
$ make build_sdks
[ -x /home/tingkai/.pulumi/bin/pulumi ] || curl -fsSL <https://get.pulumi.com> | sh
pulumi plugin install resource random 2.2.0
(cd provider && go build -a -o /home/tingkai/torchai/infra/pulumi-oneandone/tmp/pulumi-oneandone/bin/pulumi-tfgen-oneandone -ldflags "-X <http://github.com/tz-torchai/pulumi-oneandone/provider/pkg/version.Version=0.0.1-alpha.1623235147+2e15515f.dirty|github.com/tz-torchai/pulumi-oneandone/provider/pkg/version.Version=0.0.1-alpha.1623235147+2e15515f.dirty>" <http://github.com/tz-torchai/pulumi-oneandone/provider/cmd/pulumi-tfgen-oneandone)|github.com/tz-torchai/pulumi-oneandone/provider/cmd/pulumi-tfgen-oneandone)>
# <http://github.com/tz-torchai/pulumi-oneandone/provider|github.com/tz-torchai/pulumi-oneandone/provider>
./resources.go:94:46: impossible type assertion:
        *"<http://github.com/hashicorp/terraform-plugin-sdk/helper/schema|github.com/hashicorp/terraform-plugin-sdk/helper/schema>".Provider does not implement "<http://github.com/hashicorp/terraform/terraform|github.com/hashicorp/terraform/terraform>".ResourceProvider (wrong type for Apply method)
                have Apply(*"<http://github.com/hashicorp/terraform-plugin-sdk/terraform|github.com/hashicorp/terraform-plugin-sdk/terraform>".InstanceInfo, *"<http://github.com/hashicorp/terraform-plugin-sdk/terraform|github.com/hashicorp/terraform-plugin-sdk/terraform>".InstanceState, *"<http://github.com/hashicorp/terraform-plugin-sdk/terraform|github.com/hashicorp/terraform-plugin-sdk/terraform>".InstanceDiff) (*"<http://github.com/hashicorp/terraform-plugin-sdk/terraform|github.com/hashicorp/terraform-plugin-sdk/terraform>".InstanceState, error)
                want Apply(*"<http://github.com/hashicorp/terraform/terraform|github.com/hashicorp/terraform/terraform>".InstanceInfo, *"<http://github.com/hashicorp/terraform/terraform|github.com/hashicorp/terraform/terraform>".InstanceState, *"<http://github.com/hashicorp/terraform/terraform|github.com/hashicorp/terraform/terraform>".InstanceDiff) (*"<http://github.com/hashicorp/terraform/terraform|github.com/hashicorp/terraform/terraform>".InstanceState, error)
make: *** [Makefile:50: tfgen] Error 2
how could i fix this error? thanks!
b
can you share line 94 in your
resources.go
?
b
@billowy-army-68599 thanks for checking! here is the line 94
sorry to ping you, i was hoping the the message won't got lost. i also published the whole repo if that is helpful
b
i can't look now as it's late here, try me Monday and I'll be sure to give you a hand
b
👍 appreciate it, have a great weekend!
b
Hi @bored-monitor-99026 - I will be honest with you here - I don't believe this provider will convert - it's a very old Terraform provider that does not use the up to date plugin functionality since Terraform 0.12.0 - therefore, our codegen won't work with that I'm afraid
b
thanks for your input! however, there is pr that make it compatible with 0.12.x: https://github.com/hashicorp/terraform-provider-oneandone/pull/30 given this, is there any chance this provider will be converted to a pulumi provider?
b
@bored-monitor-99026 that PR has been open for over a year 😞 if it gets merged you'll be able to bridge the provider easily, but until then it won't be possible
b
it won't be merged - the repo has been archived
b
ok, thanks all, then i think the only option left here is to create a new pulumi provider. but i have some issue using pulumi-provider-boilerplate. could you take a look at the thread here? thanks!