orange-policeman-59119
06/13/2023, 9:59 PMComputeDefaults
and AutoAliasing
, and we've also made PF based providers use the same tfbridge.ProviderInfo
as SDKv2 providers.
Implementing this, you'll modify your Provider
constructor (typically in resources.go
) to return or use the original tfbridge.ProviderInfo
instead of using a plugin framework (pf/tfbridge
) version. You'll pass the upstream provider to the P
field, as with SDKv2 providers, but you'll use pf.ShimProvider()
instead of shimv2.NewProvider
.
We have examples in our unit tests here:
https://github.com/pulumi/pulumi-terraform-bridge/blob/adfd7f99c35316d683a6fcd562f816ac3c765bb2/pf/tests/internal/testprovider/random.go#L64-L66enough-garden-22763
07/03/2023, 1:10 PMicy-oil-74929
07/03/2023, 3:55 PMenvironment
which should be an enum, how do I do that?
And lastly, I am getting this weird error:
panic: invalid Go source code:
amma/resources/init.go
: 35:18: expected operand, found '.' (and 1 more errors)
I cannot identify the cause 😕icy-oil-74929
07/03/2023, 4:24 PMpowerful-lighter-63321
07/14/2023, 8:37 AMbig-architect-71258
07/25/2023, 3:15 PMExtraFunctions
field in in the ProviderInfo
struct inside TF Bridge. How is it supposed to be used?
Backgroud: I wanna add a getClientToken
function to the Azure Classic provider. Just like the function which is available in the Azure Native provider.
I think I created the declaration correctly because tfgen
creates the `schema.json`file with the added function definition without an error.
ExtraFunctions: map[string]pschema.FunctionSpec{
"azure:core/getClientToken:getClientToken": {
Description: "Use this function to get an Azure authentication token for the current login context.",
Inputs: &pschema.ObjectTypeSpec{
Type: "string",
Description: "Optional authentication endpoint. Defaults to the endpoint of Azure Resource Manager.",
},
Outputs: &pschema.ObjectTypeSpec{
Type: "string",
Description: "OAuth token for Azure Management API and SDK authentication.",
},
},
},
"azure:core/getClientToken:getClientToken": {
"description": "Use this function to get an Azure authentication token for the current login context.",
"inputs": {
"description": "Optional authentication endpoint. Defaults to the endpoint of Azure Resource Manager.",
"type": "string"
},
"outputs": {
"description": "OAuth token for Azure Management API and SDK authentication.",
"type": "string"
}
},
But now I'm stuck, because I don't know where to put the function implementation. Can someone help me here?
I found this PR of @microscopic-pilot-97530 that sheds some light on this. But neither I know how to create a multiplexed provider nor do I know how to
create an "overlay" 😀
https://github.com/pulumi/pulumi-terraform-bridge/pull/625happy-napkin-59884
07/25/2023, 5:59 PM$make tfgen
[ -x /opt/homebrew/bin/pulumi ] || curl -fsSL <https://get.pulumi.com> | sh
pulumi plugin install resource random 4.3.1
(cd provider && go build -o /Users/gsuess/SemDatex/pulumi/harvester/bin/pulumi-tfgen-harvester -ldflags "-X <http://github.com/semdatex/pulumi-harvester/provider/pkg/version.Version=0.0.1-alpha.1688662856+041f43bc.dirty|github.com/semdatex/pulumi-harvester/provider/pkg/version.Version=0.0.1-alpha.1688662856+041f43bc.dirty>" <http://github.com/semdatex/pulumi-harvester/provider/cmd/pulumi-tfgen-harvester)|github.com/semdatex/pulumi-harvester/provider/cmd/pulumi-tfgen-harvester)>
# <http://github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2|github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2>
../../../../go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.54.1/pkg/tfshim/sdk-v2/resource.go:24:26: r.tf.SchemaMap undefined (type *schema.Resource has no field or method SchemaMap)
../../../../go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.54.1/pkg/tfshim/sdk-v2/resource.go:90:67: r.tf.SchemaMap undefined (type *schema.Resource has no field or method SchemaMap)
../../../../go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.54.1/pkg/tfshim/sdk-v2/resource.go:91:22: r.tf.SchemaMap undefined (type *schema.Resource has no field or method SchemaMap)
../../../../go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.54.1/pkg/tfshim/sdk-v2/schema.go:137:23: e.SchemaMap undefined (type *schema.Resource has no field or method SchemaMap)
make: *** [tfgen] Error 1
bright-receptionist-28471
07/26/2023, 4:59 PMmake tfgen
I’m getting this warning:
warning: ProviderInfo.P should be nil for Plugin Framework based providers, populate NewProvider instead
Which seems to contradict the guide
info := tfbridge.ProviderInfo{
P: pf.ShimProvider(<TODO fill in Terraform Provider from Step 1>),
I’m having trouble determining what the message means by “populate NewProvider instead”, that doesn’t seem to be a field on ProviderInfo
, so I must be missing something herebright-receptionist-28471
07/28/2023, 5:17 PMpulumi-tf-provider-boilerplate
Release action https://github.com/pulumi/pulumi-tf-provider-boilerplate/blob/main/deployment-templates/release.yml, I’m getting this error:
2023-07-28T16:58:19.2283364Z ##[group]Run actions/setup-node@v3
2023-07-28T16:58:19.2283630Z with:
2023-07-28T16:58:19.2283904Z registry-url: <https://registry.npmjs.org>
2023-07-28T16:58:19.2284198Z always-auth: false
2023-07-28T16:58:19.2284423Z check-latest: false
2023-07-28T16:58:19.2284771Z token: ***
2023-07-28T16:58:19.2284972Z env:
2023-07-28T16:58:19.2285288Z GITHUB_TOKEN: ***
2023-07-28T16:58:19.2285798Z NODE_AUTH_TOKEN: ***
2023-07-28T16:58:19.2286118Z NPM_TOKEN: ***
2023-07-28T16:58:19.2286344Z PUBLISH_NPM: true
2023-07-28T16:58:19.2286618Z NPM_REGISTRY_URL: <https://registry.npmjs.org>
2023-07-28T16:58:19.2288001Z PYPI_PASSWORD: ***
2023-07-28T16:58:19.2288239Z PUBLISH_PYPI: true
2023-07-28T16:58:19.2288464Z ##[endgroup]
2023-07-28T16:58:19.4233625Z ##[group]Environment details
2023-07-28T16:58:20.3979012Z node: v18.17.0
2023-07-28T16:58:20.3979705Z npm: 9.6.7
2023-07-28T16:58:20.3980480Z yarn: 1.22.19
2023-07-28T16:58:20.3981387Z ##[endgroup]
2023-07-28T16:58:20.4065437Z ##[group]Run actions/download-artifact@v2
2023-07-28T16:58:20.4065701Z with:
2023-07-28T16:58:20.4065919Z name: nodejs-sdk.tar.gz
2023-07-28T16:58:20.4066235Z path: /home/runner/work/pulumi-prodvana/pulumi-prodvana/sdk/
2023-07-28T16:58:20.4066522Z env:
2023-07-28T16:58:20.4066880Z GITHUB_TOKEN: ***
2023-07-28T16:58:20.4067201Z NODE_AUTH_TOKEN: ***
2023-07-28T16:58:20.4067526Z NPM_TOKEN: ***
2023-07-28T16:58:20.4067767Z PUBLISH_NPM: true
2023-07-28T16:58:20.4068056Z NPM_REGISTRY_URL: <https://registry.npmjs.org>
2023-07-28T16:58:20.4069430Z PYPI_PASSWORD: ***
2023-07-28T16:58:20.4069655Z PUBLISH_PYPI: true
2023-07-28T16:58:20.4069938Z NPM_CONFIG_USERCONFIG: /home/runner/work/_temp/.npmrc
2023-07-28T16:58:20.4070215Z ##[endgroup]
2023-07-28T16:58:20.4655024Z Starting download for nodejs-sdk.tar.gz
2023-07-28T16:58:20.5098216Z ##[error]Unable to find any artifacts for the associated workflow
My read here is that the SDKs are not being built first, which makes sense, there’s nothing in release.yml
that builds them. But I wanted to double check I’m not missing something before adding a job to build the sdks.thankful-match-46035
08/17/2023, 6:55 PMwitty-soccer-50353
08/20/2023, 10:38 AMpulumi-go-provider
and having some trouble annotating a nested data structure:
type Inputs struct {
Children *[]Child `pulumi:"children,optional"`
}
type Child struct {
Name string `pulumi:"name"`
}
func (c *Inputs) Annotate(a infer.Annotator) {
a.Describe(???, "Name description")
}
Is this something that is not yet supported?better-scooter-29497
08/22/2023, 3:12 PMv2
in the module spec. However, the go.mod file of the provider defines the path as `github.com/terraform-providers/terraform-provider-bitbucket`; with no v2, and with a different username than where it’s actually hosted (which is https://github.com/DrFaust92/terraform-provider-bitbucket). How can I solve this?kind-jelly-61624
08/22/2023, 5:36 PMwitty-soccer-50353
08/28/2023, 3:53 PMpulumi-go-provider
to develop a new provider? I am aware of pulumi-command
, but would be great if anyone could share other real-world examples. Thanks!alert-nightfall-64120
09/04/2023, 5:33 PMalert-nightfall-64120
09/04/2023, 5:33 PMalert-nightfall-64120
09/04/2023, 5:36 PMalert-nightfall-64120
09/04/2023, 5:41 PMalert-nightfall-64120
09/04/2023, 6:47 PMbig-architect-71258
09/05/2023, 6:21 PMpulumi-time
and pulumi-mssql
on #pulumiverse and I was wondering how I can keep the GitHub workflows up to date in some way automatically. I know there is a tool for the "normal" Pulumi providers (which are maintained by Pulumi) to do this. Is there something planned for Pulumiverse?bright-receptionist-28471
09/06/2023, 3:34 PMpulumi import
. I tested the equivalent import through the bridged Terraform provider directly, and it worked without issue. This leads me to believe the error is originating in how the provider is bridged, but I’m not sure where to look to debug further:
error: Preview failed: cannot encode resource inputs to call ValidateResourceConfig: objectEncoder failed on property "policy": objectEncoder failed on property "default_env": encMap failed on {[]}
Any tips for figuring this out?
(I’ve confirmed that it does work if if I remove the default_env
property from the cloud resource)acoustic-tiger-77630
09/06/2023, 11:56 PMmake tfgen
again, but it failed with the following error:
# <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.76.1/resource/deploy/deploytest/languageruntime.go:31:9: cannot use &languageRuntime{…} (value of type *languageRuntime) as plugin.LanguageRuntime value in return statement: *languageRuntime does not implement plugin.LanguageRuntime (wrong type for method GeneratePackage)
have GeneratePackage(string, string, map[string][]byte) error
want GeneratePackage(string, string, map[string][]byte, string) error
# <http://github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tf2pulumi/il|github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tf2pulumi/il>
../../../../../pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.58.0/pkg/tf2pulumi/il/plugin_info.go:182:82: not enough arguments in call to workspace.GetPluginPath
have ("<http://github.com/pulumi/pulumi/sdk/v3/go/common/workspace|github.com/pulumi/pulumi/sdk/v3/go/common/workspace>".PluginKind, string, nil, nil)
want (diag.Sink, "<http://github.com/pulumi/pulumi/sdk/v3/go/common/workspace|github.com/pulumi/pulumi/sdk/v3/go/common/workspace>".PluginKind, string, *"<http://github.com/blang/semver|github.com/blang/semver>".Version, []"<http://github.com/pulumi/pulumi/sdk/v3/go/common/workspace|github.com/pulumi/pulumi/sdk/v3/go/common/workspace>".ProjectPlugin)
# <http://github.com/pulumi/pulumi/pkg/v3/engine|github.com/pulumi/pulumi/pkg/v3/engine>
../../../../../pkg/mod/github.com/pulumi/pulumi/pkg/v3@v3.76.1/engine/plugins.go:190:76: not enough arguments in call to workspace.GetPluginPath
have ("<http://github.com/pulumi/pulumi/sdk/v3/go/common/workspace|github.com/pulumi/pulumi/sdk/v3/go/common/workspace>".PluginKind, string, *semver.Version, []"<http://github.com/pulumi/pulumi/sdk/v3/go/common/workspace|github.com/pulumi/pulumi/sdk/v3/go/common/workspace>".ProjectPlugin)
want (diag.Sink, "<http://github.com/pulumi/pulumi/sdk/v3/go/common/workspace|github.com/pulumi/pulumi/sdk/v3/go/common/workspace>".PluginKind, string, *semver.Version, []"<http://github.com/pulumi/pulumi/sdk/v3/go/common/workspace|github.com/pulumi/pulumi/sdk/v3/go/common/workspace>".ProjectPlugin)
# <http://github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2|github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2>
../../../../../pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.58.0/pkg/tfshim/sdk-v2/resource.go:24:26: r.tf.SchemaMap undefined (type *schema.Resource has no field or method SchemaMap)
../../../../../pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.58.0/pkg/tfshim/sdk-v2/resource.go:90:67: r.tf.SchemaMap undefined (type *schema.Resource has no field or method SchemaMap)
../../../../../pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.58.0/pkg/tfshim/sdk-v2/resource.go:91:22: r.tf.SchemaMap undefined (type *schema.Resource has no field or method SchemaMap)
../../../../../pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.58.0/pkg/tfshim/sdk-v2/schema.go:137:23: e.SchemaMap undefined (type *schema.Resource has no field or method SchemaMap)
make: *** [tfgen] Error 1
The same error is returned when attempting to regenerate the sdks.
Any ideas on how I can solve this?thankful-match-46035
09/11/2023, 12:31 PMbuild_nodejs
makefile target have been changed.
When we upgrade our provider synced to a terraform provider, several dependencies are upgraded automatically, so the upgrade failed on my side.
I need to go to pulumi-aws github repo to see the “new” build_nodejs make target code block without the “cp scripts/” instruction.
How can we have the information of breaking change?
Thanksthankful-match-46035
09/12/2023, 7:25 AMnpm ERR! 403 403 Forbidden - PUT <https://registry.npmjs.org/@ovh-devrelteam%2fpulumi-ovh> - You cannot publish over the previously published versions: 0.34.0.
I’ve read the guide and it appears that normally the gh action will NOT try to publish again an existing npm package because a check is done in the package.json
file.
So, my question is, why the gh action wants to publish the npm package even if the version seems the same?
Second question: have you a release.yaml gh action optimized in order to not publish existing package (npm, pypi, nuget...)
Thanksenough-garden-22763
09/12/2023, 9:24 PMbig-architect-71258
09/13/2023, 7:40 AMthankful-match-46035
09/13/2023, 11:22 AMpackage.json
is not good: “v0.34.0” instead of “0.34.0" for example.
Have you already fixed this issue somewhere?
Moreover a page in the official documentation with all the possible known issues, with a latest version of the Gh actions and all the useful information we can have could be very useful.
Thanks 🙂quaint-spring-93350
09/13/2023, 1:01 PMplugin.json
file per each provider package and puts it into the jar (onto the classpath). These files are then searched for using classpath search using an auxiliary jar (similar to what pulumi-java does) with that functionality to expose all the packages that user has in his program. We currently generate a json of this shape:
{
"resource": true,
"name": "<PLUGIN_NAME>",
"version": "<PLUGIN_VERSION>"
}
Should we pass information about pluginDownloadURL
here also?straight-cartoon-24485
09/20/2023, 8:50 PMpulumi-openwrt/examples/openwrt-system/ts 255 pulumi up
Previewing update (dev)
View in Browser (Ctrl+O): <https://app.pulumi.com/pcuci/ts/dev/previews/d4770506-61cd-4002-b5f4-2ae37c244f8f>
Type Name Plan Info
+ pulumi:pulumi:Stack ts-dev create
└─ pulumi:providers:openwrt openwrtProvider 1 error
Diagnostics:
pulumi:providers:openwrt (openwrtProvider):
error: Could not automatically download and install resource plugin 'pulumi-resource-openwrt' at version v0.0.1-alpha.1695222502+35e1f4e7.dirty, install the plugin using `pulumi plugin install resource openwrt v0.0.1-alpha.1695222502+35e1f4e7.dirty --server <github://api.github.com/deposition-cloud/pulumi-openwrt>`: error downloading provider openwrt to file: failed to download plugin: openwrt-0.0.1-alpha.1695222502+35e1f4e7.dirty: 404 HTTP error fetching plugin from <https://api.github.com/repos/deposition-cloud/pulumi-openwrt/releases/tags/v0.0.1-alpha.1695222502+35e1f4e7.dirty>. If this is a private GitHub repository, try providing a token via the GITHUB_TOKEN environment variable. See: <https://github.com/settings/tokens>
Code here: https://github.com/deposition-cloud/pulumi-openwrt - in case anyone familiar with the bridging workflow wants to have a look; what am I missing?
...after the second run of make tfgen
I noticed the .dirty
suffix—what exactly is happening here?big-architect-71258
09/21/2023, 11:48 AMpulumi-fortios
provider and I want to add (copy) a couple of how-to
documents from the upstream TF provider. I would like to create a section where these documents are collected, just like the Azure Native Provider (ref. screenshot). I have seen that the documents for the Azure Native Provider are stored directly in the pulumi/docs
repository (ref. screenshot). However, the Fortios provider is hosted on #pulumiverse.
So how can I create this section without having to add the documents to the pulumi/docs repository?