sparse-intern-71089
02/05/2024, 6:34 PMbig-architect-71258
02/05/2024, 7:09 PMzpa.Provider()
to zpa.ZPAProvider()
in resources.go
.
To get the documentation correctly you need the code of the Terraform Provider git cloned to the upstream
directory.
To automate this you can add the following lines to Makefile
PULUMI_REPO_PATHS:= <http://github.com/<repo-of-provider>=$(ROOT_DIR)/upstream|github.com/<repo-of-provider>=$(ROOT_DIR)/upstream>
upstream/.git:
@echo "Initializing upstream" ; \
git clone --depth 1 --branch <version-of-the-provider> <https://github.com/><repo-of-provider> upstream
tfgen:: install_plugins upstream/.git
As I'm writing this I think I should add this to the template 😄big-architect-71258
02/05/2024, 7:15 PMTFProviderModuleVersion: "v3",
to resources.go
just after GitHubOrg:
tfgen
is able to resolve the provider repo and thus create the documentation.acoustic-tiger-77630
02/05/2024, 7:30 PMmake tfgen
[ -x /opt/homebrew/bin/pulumi ] || curl -fsSL <https://get.pulumi.com> | sh
pulumi plugin install resource random 4.8.2
(cd provider && go build -o /Users/wguilherme/go/src/github.com/zscaler/pulumi-zpa/bin/pulumi-tfgen-zpa -ldflags "-X <http://github.com/zscaler/pulumi-zpa/provider/pkg/version.Version=0.0.1-alpha.1707113237+ddbd1aa8.dirty|github.com/zscaler/pulumi-zpa/provider/pkg/version.Version=0.0.1-alpha.1707113237+ddbd1aa8.dirty>" <http://github.com/zscaler/pulumi-zpa/provider/cmd/pulumi-tfgen-zpa)|github.com/zscaler/pulumi-zpa/provider/cmd/pulumi-tfgen-zpa)>
# <http://github.com/pulumi/pulumi/pkg/v3/resource/deploy/deploytest|github.com/pulumi/pulumi/pkg/v3/resource/deploy/deploytest>
../../../../../pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.103.1/resource/deploy/deploytest/languageruntime.go:59:58: undefined: plugin.ProgInfo
../../../../../pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.103.1/resource/deploy/deploytest/languageruntime.go:109:14: undefined: plugin.ProgInfo
../../../../../pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.103.1/resource/deploy/deploytest/pluginhost.go:293:9: cannot use &pluginHost{…} (value of type *pluginHost) as plugin.Host value in return statement: *pluginHost does not implement plugin.Host (wrong type for method LanguageRuntime)
have LanguageRuntime(string, string, string, map[string]interface{}) (plugin.LanguageRuntime, error)
want LanguageRuntime(string, plugin.ProgramInfo) (plugin.LanguageRuntime, error)
../../../../../pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.103.1/resource/deploy/deploytest/pluginhost.go:334:35: cannot use host (variable of type *pluginHost) as plugin.Host value in argument to best.loadWithHost: *pluginHost does not implement plugin.Host (wrong type for method LanguageRuntime)
have LanguageRuntime(string, string, string, map[string]interface{}) (plugin.LanguageRuntime, error)
want LanguageRuntime(string, plugin.ProgramInfo) (plugin.LanguageRuntime, error)
../../../../../pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.103.1/resource/deploy/deploytest/pluginhost.go:503:56: undefined: plugin.ProgInfo
# <http://github.com/pulumi/pulumi/pkg/v3/resource/deploy|github.com/pulumi/pulumi/pkg/v3/resource/deploy>
../../../../../pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.103.1/resource/deploy/source_eval.go:225:104: too many arguments in call to iter.src.plugctx.Host.LanguageRuntime
have (string, string, string, map[string]interface{})
want (string, plugin.ProgramInfo)
../../../../../pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.103.1/resource/deploy/source_eval.go:237:5: unknown field Program in struct literal of type plugin.RunInfo
../../../../../pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.103.1/resource/deploy/source_query.go:145:87: too many arguments in call to src.plugctx.Host.LanguageRuntime
have (string, string, string, map[string]interface{})
want (string, plugin.ProgramInfo)
../../../../../pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.103.1/resource/deploy/source_query.go:172:3: unknown field Program in struct literal of type plugin.RunInfo
# <http://github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema|github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema>
../../../../../pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20230710100801-03a71d0fca3d/helper/schema/provider.go:511:9: cannot use NewGRPCProviderServer(p) (value of type *GRPCProviderServer) as tfprotov5.ProviderServer value in return statement: *GRPCProviderServer does not implement tfprotov5.ProviderServer (missing method GetMetadata)
make: *** [tfgen] Error 1
big-architect-71258
02/05/2024, 7:32 PMbig-architect-71258
02/05/2024, 7:34 PM/tmp/pulumi-zpa/sdk/dotnet/Ba/Certificate.cs(26,31): error CS0542: 'Certificate': member names cannot be the same as their enclosing type [/tmp/pulumi-zpa/sdk/dotnet/Pulumiverse.Zpa.csproj]
/tmp/pulumi-zpa/sdk/dotnet/CloudBrowserIsolation/Banner.cs(17,29): error CS0542: 'Banner': member names cannot be the same as their enclosing type [/tmp/pulumi-zpa/sdk/dotnet/Pulumiverse.Zpa.csproj]
big-architect-71258
02/05/2024, 7:41 PMacoustic-tiger-77630
02/05/2024, 7:44 PMbig-architect-71258
02/05/2024, 7:46 PMbig-architect-71258
02/05/2024, 8:00 PMREADME-DEVELOPMENT.md
in the created repository.acoustic-tiger-77630
02/05/2024, 8:12 PMProvider module <http://github.com/zscaler/terraform-provider-zpa/v3|github.com/zscaler/terraform-provider-zpa/v3> diverges from provider source <https://github.com/zscaler/terraform-provider-zpa>
go: -replace=<http://github.com/zscaler/terraform-provider-zpa/v3=https://github.com/zscaler/terraform-provider-zpa@v3.1.0|github.com/zscaler/terraform-provider-zpa/v3=https://github.com/zscaler/terraform-provider-zpa@v3.1.0>: invalid new path: malformed import path "<https://github.com/zscaler/terraform-provider-zpa>": double slash
go: added <http://github.com/pulumi/pulumi-terraform-bridge/v3|github.com/pulumi/pulumi-terraform-bridge/v3> v3.73.0
go: downloading <http://github.com/pulumi/pulumi|github.com/pulumi/pulumi> v3.104.2+incompatible
go: downloading <http://github.com/pulumi/terraform-plugin-sdk/v2|github.com/pulumi/terraform-plugin-sdk/v2> v2.0.0-20240129205329-74776a5cd5f9
<http://github.com/zscaler/pulumi-zpa/provider|github.com/zscaler/pulumi-zpa/provider> imports
<http://github.com/zscaler/terraform-provider-zpa/v3/https://github.com/zscaler/terraform-provider-zpa/blob/master/zpa/provider.go|github.com/zscaler/terraform-provider-zpa/v3/https://github.com/zscaler/terraform-provider-zpa/blob/master/zpa/provider.go>: malformed import path "<http://github.com/zscaler/terraform-provider-zpa/v3/https://github.com/zscaler/terraform-provider-zpa/blob/master/zpa/provider.go|github.com/zscaler/terraform-provider-zpa/v3/https://github.com/zscaler/terraform-provider-zpa/blob/master/zpa/provider.go>": double slash
Initialized empty Git repository in /Users/wguilherme/go/src/github.com/zscaler/pulumi-providers/pulumi-tf-provider-cookiecutter/pulumi-zpa/.git/
[main (root-commit) e84c8a9] Initial Commit.
acoustic-tiger-77630
02/05/2024, 8:13 PMbig-architect-71258
02/05/2024, 8:15 PMmodule
string right. The ZPA Provider is using /v3
. These are my settings
"terraform_provider_name": "zpa",
"terraform_provider_org": "zscaler",
"terraform_provider_source": "github.com/zscaler/terraform-provider-zpa",
"terraform_provider_version_or_commit": "3.1.0",
"terraform_provider_module": "github.com/zscaler/terraform-provider-zpa/v3",
"terraform_provider_package_name": "zpa",
"terraform_sdk_version": "2",
Cookiecutter has a replay function. Simply edit the vi ~/.cookiecutter_replay/pulumi-tf-provider-cookiecutter.json
and change the settings and call cookiecutter -f --replay gh:tmeckel/pulumi-tf-provider-cookiecutter
salmon-account-74572
02/05/2024, 8:35 PM