Can anyone help me with this error? I'm trying to ...
# pulumiverse
r
Can anyone help me with this error? I'm trying to create provider based on this SignalSciences TF provider Also, I'm using @big-architect-71258 cookiecutter template to generate the Pulumi provider Please let me know if you need more details about the setup
Copy code
# <http://github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload|github.com/hashicorp/terraform-plugin-sdk/internal/configs/configload>
/home/tklisanic/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.14.0/internal/configs/configload/loader_snapshot.go:52:30: cannot use fs (variable of type snapshotFS) as afero.Fs value in argument to configs.NewParser: snapshotFS does not implement afero.Fs (missing method Chown)
/home/tklisanic/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.14.0/internal/configs/configload/loader_snapshot.go:57:32: cannot use fs (variable of type snapshotFS) as afero.Fs value in struct literal: snapshotFS does not implement afero.Fs (missing method Chown)
/home/tklisanic/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.14.0/internal/configs/configload/loader_snapshot.go:200:18: cannot use snapshotFS{} (value of type snapshotFS) as afero.Fs value in variable declaration: snapshotFS does not implement afero.Fs (missing method Chown)
# <http://github.com/hashicorp/terraform-plugin-test|github.com/hashicorp/terraform-plugin-test>
/home/tklisanic/go/pkg/mod/github.com/hashicorp/terraform-plugin-test@v1.3.0/helper.go:184:85: not enough arguments in call to zipDecompressor.Decompress
        have (string, string, bool)
        want (string, string, bool, fs.FileMode)
make: *** [Makefile:53: tfgen] Error 1
b
@rhythmic-whale-48997 Force the afero version to 1.2.0 in the provider/go.mod
replace <http://github.com/spf13/afero|github.com/spf13/afero> => <http://github.com/spf13/afero|github.com/spf13/afero> v1.2.2
The is the version required by the Terraform SDK v1. Could be added to my Cookiecutter. To cope with
Copy code
helper.go:184:85: not enough arguments in call to zipDecompressor.Decompress
        have (string, string, bool)
        want (string, string, bool, fs.FileMode)
Force the version of github.com/hashicorp/go-getter to 1.4.0
replace <http://github.com/hashicorp/go-getter|github.com/hashicorp/go-getter> => <http://github.com/hashicorp/go-getter|github.com/hashicorp/go-getter> v1.4.0
As as hint: Pulumi is now able to wrap ANY Terraform provider on the fly https://www.pulumi.com/blog/any-terraform-provider/ perhaps you don't have to wrap the
sigsci
provider.
Oh and you won't be able to compile the C# SDK for the provider because (as usual) C# needs some special treatment.
Copy code
/tmp/pulumi-sigsci/sdk/dotnet/Site.cs(47,26): error CS0101: The namespace 'Pulumiverse.Sigsci' already contains a definition for 'Site' [/tmp/pulumi-sigsci/sdk/dotnet/Pulumiverse.Sigsci.csproj]
/tmp/pulumi-sigsci/sdk/dotnet/SiteHeader/Link.cs(53,31): error CS0542: 'Link': member names cannot be the same as their enclosing type [/tmp/pulumi-sigsci/sdk/dotnet/Pulumiverse.Sigsci.csproj]
For that you've to use the SchemaInfo struct to specify special C# settings. The following code shows a respective example:
Copy code
Fields: map[string]*tfbridge.SchemaInfo{
					"filter": {
						CSharpName: "Definition",
					},
				},
So another reason why I wouldn't manually wrap that provider if it could by handled by Pulumi automatically (ref. to linked blog post above)
r
I will try this replacements and let you know. I have tried Any provider, but it have issues with TF SDK v1 when deleting resources and it panics. Fix is merged and I'm waiting to test this also when new version of Any provider is available.
b
@rhythmic-whale-48997 If the any provider crashed it would be awesome if you could open an issue on the pulumi-terraform-bridge repo 🙏🏼
r
There was already an opened issue. I just added another comment to it to provide more context
b
Much appreciated 👍🏻
r
@big-architect-71258 just tried this and looks like it is working. I'm getting warnings that my schema is not mapped. I will try to map it and see if in the everything works as expected. Tnx much for your help