brainy-lion-38675
02/08/2022, 10:01 AM./resources.go:49:42: cannot use fortios.Provider() (type "github.com/hashicorp/terraform-plugin-sdk/terraform".ResourceProvider) as type *"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema".Provider in argument to sdkv2.NewProvider`
// go.mod
module github.com/pulumi/pulumi-fortios/provider
go 1.16
replace (
github.com/hashicorp/go-getter v1.5.0 => github.com/hashicorp/go-getter v1.4.0
github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20210402103405-f5979773e8ba
github.com/terraform-providers/terraform-provider-fortios => github.com/fortinetdev/terraform-provider-fortios v1.14.0
)
require (
github.com/pulumi/pulumi-terraform-bridge/v3 v3.13.0
github.com/pulumi/pulumi/sdk/v3 v3.19.0
github.com/terraform-providers/terraform-provider-fortios v1.3.0
)
// resources.go
package fortios
import (
"fmt"
"path/filepath"
"github.com/pulumi/pulumi-fortios/provider/pkg/version"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
shim "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim"
shimv2 "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2"
"github.com/pulumi/pulumi/sdk/v3/go/common/resource"
"github.com/terraform-providers/terraform-provider-fortios/fortios"
)
// all of the token components used below.
const (
// This variable controls the default name of the package in the package
// registries for nodejs and python:
mainPkg = "fortios"
// modules:
mainMod = "index" // the fortios module
)
// preConfigureCallback is called before the providerConfigure function of the underlying provider.
// It should validate that the provider can be configured, and provide actionable errors in the case
// it cannot be. Configuration variables can be read from `vars` using the `stringValue` function -
// for example `stringValue(vars, "accessKey")`.
func preConfigureCallback(vars resource.PropertyMap, c shim.ResourceConfig) error {
return nil
}
// Provider returns additional overlaid schema and metadata associated with the provider..
func Provider() tfbridge.ProviderInfo {
// Instantiate the Terraform provider
p := shimv2.NewProvider(fortios.Provider())
// Create a Pulumi provider mapping
prov := tfbridge.ProviderInfo{
P: p,
Name: "fortios",
DisplayName: "",
...