initial commit

This commit is contained in:
2025-04-18 13:26:52 -07:00
commit b78296ab5b
134 changed files with 11623 additions and 0 deletions

View File

@@ -0,0 +1 @@
schema.go

View File

@@ -0,0 +1,17 @@
{
"auto-aliasing": {
"resources": {
"xyz_resource": {
"current": "xyz:index/resource:Resource",
"majorVersion": 1
}
},
"datasources": {
"xyz_data_source": {
"current": "xyz:index/getDataSource:getDataSource",
"majorVersion": 1
}
}
},
"auto-settings": {}
}

View File

@@ -0,0 +1,32 @@
// Copyright 2016-2018, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
_ "embed"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
xyz "github.com/pulumi/pulumi-xyz/provider"
"github.com/pulumi/pulumi-xyz/provider/pkg/version"
)
//go:embed schema.json
var pulumiSchema []byte
func main() {
// Modify the path to point to the new provider
tfbridge.Main("xyz", version.Version, xyz.Provider(), pulumiSchema)
}

View File

@@ -0,0 +1,146 @@
{
"name": "xyz",
"description": "A Pulumi package for creating and managing xyz cloud resources.",
"keywords": [
"xyz",
"category/cloud"
],
"homepage": "https://www.pulumi.com",
"license": "Apache-2.0",
"attribution": "This Pulumi package is based on the [`xyz` Terraform Provider](https://github.com/terraform-providers/terraform-provider-xyz).",
"repository": "https://github.com/pulumi/pulumi-xyz",
"publisher": "Pulumi",
"meta": {
"moduleFormat": "(.*)(?:/[^/]*)"
},
"language": {
"csharp": {
"packageReferences": {
"Pulumi": "3.*"
},
"compatibility": "tfbridge20",
"respectSchemaVersion": true
},
"go": {
"importBasePath": "github.com/pulumi/pulumi-xyz/sdk/go/xyz",
"generateResourceContainerTypes": true,
"generateExtraInputTypes": true,
"respectSchemaVersion": true
},
"nodejs": {
"packageDescription": "A Pulumi package for creating and managing xyz cloud resources.",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-xyz)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-xyz` repo](https://github.com/pulumi/pulumi-xyz/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-xyz` repo](https://github.com/terraform-providers/terraform-provider-xyz/issues).",
"compatibility": "tfbridge20",
"disableUnionOutputTypes": true,
"respectSchemaVersion": true
},
"python": {
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-xyz)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-xyz` repo](https://github.com/pulumi/pulumi-xyz/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-xyz` repo](https://github.com/terraform-providers/terraform-provider-xyz/issues).",
"compatibility": "tfbridge20",
"respectSchemaVersion": true,
"pyproject": {
"enabled": true
}
}
},
"config": {
"variables": {
"region": {
"type": "string",
"$ref": "#/types/xyz:region/region:Region",
"description": "A region which should be used.\n"
}
}
},
"types": {
"xyz:region/region:Region": {
"type": "string",
"enum": [
{
"name": "here",
"value": "HERE"
},
{
"name": "overThere",
"value": "OVER_THERE"
}
]
}
},
"provider": {
"description": "The provider type for the xyz package. By default, resources use package-wide configuration\nsettings, however an explicit `Provider` instance may be created and passed during resource\nconstruction to achieve fine-grained programmatic control over provider settings. See the\n[documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.\n",
"properties": {
"region": {
"type": "string",
"$ref": "#/types/xyz:region/region:Region",
"description": "A region which should be used.\n"
}
},
"inputProperties": {
"region": {
"type": "string",
"$ref": "#/types/xyz:region/region:Region",
"description": "A region which should be used.\n"
}
}
},
"resources": {
"xyz:index/resource:Resource": {
"properties": {
"sampleAttribute": {
"type": "string",
"description": "Sample attribute.\n"
}
},
"inputProperties": {
"sampleAttribute": {
"type": "string",
"description": "Sample attribute.\n"
}
},
"stateInputs": {
"description": "Input properties used for looking up and filtering Resource resources.\n",
"properties": {
"sampleAttribute": {
"type": "string",
"description": "Sample attribute.\n"
}
},
"type": "object"
}
}
},
"functions": {
"xyz:index/getDataSource:getDataSource": {
"inputs": {
"description": "A collection of arguments for invoking getDataSource.\n",
"properties": {
"sampleAttribute": {
"type": "string"
}
},
"type": "object",
"required": [
"sampleAttribute"
]
},
"outputs": {
"description": "A collection of values returned by getDataSource.\n",
"properties": {
"id": {
"description": "The provider-assigned unique ID for this managed resource.\n",
"type": "string"
},
"sampleAttribute": {
"type": "string"
}
},
"required": [
"sampleAttribute",
"id"
],
"type": "object"
}
}
}
}

View File

@@ -0,0 +1,27 @@
// Copyright 2016-2018, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfgen"
xyz "github.com/pulumi/pulumi-xyz/provider"
"github.com/pulumi/pulumi-xyz/provider/pkg/version"
)
func main() {
// Modify the path to point to the new provider
tfgen.Main("xyz", version.Version, xyz.Provider())
}

186
provider/go.mod Normal file
View File

@@ -0,0 +1,186 @@
module github.com/pulumi/pulumi-xyz/provider
go 1.22.7
toolchain go1.23.0
replace github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20250221232320-8d4cfd37a3cd
require (
github.com/pulumi/pulumi-terraform-bridge/v3 v3.106.0
github.com/pulumi/pulumi/pkg/v3 v3.160.0
github.com/pulumi/terraform-provider-xyz v0.0.3
)
require (
cloud.google.com/go v0.112.1 // indirect
cloud.google.com/go/compute/metadata v0.5.2 // indirect
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/storage v1.39.1 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v1.1.5 // indirect
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-cidr v1.1.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aws/aws-sdk-go v1.50.36 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/charmbracelet/bubbles v0.16.1 // indirect
github.com/charmbracelet/bubbletea v0.25.0 // indirect
github.com/charmbracelet/lipgloss v0.7.1 // indirect
github.com/cheggaaa/pb v1.0.29 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
github.com/deckarep/golang-set/v2 v2.5.0 // indirect
github.com/djherbis/times v1.5.0 // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/ettle/strcase v0.1.1 // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.6.2 // indirect
github.com/go-git/go-git/v5 v5.13.2 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.4 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.2 // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
github.com/hashicorp/go-getter v1.7.5 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-safetemp v1.0.0 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl/v2 v2.23.0 // indirect
github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.26.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/cli v1.1.5 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/hashstructure v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/natefinch/atomic v1.0.1 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/opentracing/basictracer-go v1.1.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pgavlin/fx v0.1.6 // indirect
github.com/pgavlin/goldmark v1.1.33-0.20200616210433-b5eb04559386 // indirect
github.com/pjbgf/sha1cd v0.3.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/term v1.1.0 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect
github.com/pulumi/esc v0.10.0 // indirect
github.com/pulumi/inflector v0.1.1 // indirect
github.com/pulumi/pulumi-java/pkg v1.8.0 // indirect
github.com/pulumi/pulumi-yaml v1.15.1 // indirect
github.com/pulumi/pulumi/sdk/v3 v3.160.0 // indirect
github.com/pulumi/schema-tools v0.1.2 // indirect
github.com/pulumi/terraform-diff-reader v0.0.2 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect
github.com/segmentio/asm v1.1.3 // indirect
github.com/segmentio/encoding v0.3.5 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/skeema/knownhosts v1.3.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.9.1 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/teekennedy/goldmark-markdown v0.3.0 // indirect
github.com/texttheater/golang-levenshtein v1.0.1 // indirect
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/yuin/goldmark v1.7.7 // indirect
github.com/zclconf/go-cty v1.16.2 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.31.0 // indirect
go.opentelemetry.io/otel/metric v1.31.0 // indirect
go.opentelemetry.io/otel/trace v1.31.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.29.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.23.0 // indirect
google.golang.org/api v0.169.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/grpc v1.69.4 // indirect
google.golang.org/protobuf v1.36.3 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/frand v1.4.2 // indirect
)

3451
provider/go.sum Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
// Copyright 2016-2018, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package version
// Version is initialized by the Go linker to contain the semver of this build.
var Version string

206
provider/resources.go Normal file
View File

@@ -0,0 +1,206 @@
// Copyright 2016-2024, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package xyz
import (
"path"
// Allow embedding bridge-metadata.json in the provider.
_ "embed"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge"
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge/tokens"
shimv2 "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2"
"github.com/pulumi/pulumi/pkg/v3/codegen/schema"
xyz "github.com/pulumi/terraform-provider-xyz/provider" // Import the upstream provider
"github.com/pulumi/pulumi-xyz/provider/pkg/version"
)
// 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 = "xyz"
// modules:
mainMod = "index" // the xyz module
)
//go:embed cmd/pulumi-resource-xyz/bridge-metadata.json
var metadata []byte
// Provider returns additional overlaid schema and metadata associated with the provider.
func Provider() tfbridge.ProviderInfo {
// Create a Pulumi provider mapping
prov := tfbridge.ProviderInfo{
// Instantiate the Terraform provider
//
// The [pulumi-terraform-bridge](https://github.com/pulumi/pulumi-terraform-bridge) supports 3
// types of Terraform providers:
//
// 1. Providers written with the terraform-plugin-sdk/v1:
//
// If the provider you are bridging is written with the terraform-plugin-sdk/v1, then you
// will need to adapt the boilerplate:
//
// - Change the import "shimv2" to "shimv1" and change the associated import to
// "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v1".
//
// You can then proceed as normal.
//
// 2. Providers written with terraform-plugin-sdk/v2:
//
// This boilerplate is already geared towards providers written with the
// terraform-plugin-sdk/v2, since it is the most common provider framework used. No
// adaptions are needed.
//
// 3. Providers written with terraform-plugin-framework:
//
// If the provider you are bridging is written with the terraform-plugin-framework, then
// you will need to adapt the boilerplate:
//
// - Remove the `shimv2` import and add:
//
// pfbridge "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/pf/tfbridge"
//
// - Replace `shimv2.NewProvider` with `pfbridge.ShimProvider`.
//
// - In provider/cmd/pulumi-tfgen-xyz/main.go, replace the
// "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfgen" import with
// "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/pf/tfgen". Remove the `version.Version`
// argument to `tfgen.Main`.
//
// - In provider/cmd/pulumi-resource-xyz/main.go, replace the
// "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge" import with
// "github.com/pulumi/pulumi-terraform-bridge/v3/pkg/pf/tfbridge". Replace the arguments to the
// `tfbridge.Main` so it looks like this:
//
// tfbridge.Main(context.Background(), "xyz", xyz.Provider(),
// tfbridge.ProviderMetadata{PulumiSchema: pulumiSchema})
//
// Detailed instructions can be found at
// https://pulumi-developer-docs.readthedocs.io/projects/pulumi-terraform-bridge/en/latest/docs/guides/new-pf-provider.html
// After that, you can proceed as normal.
//
// This is where you give the bridge a handle to the upstream terraform provider. SDKv2
// convention is to have a function at "github.com/pulumi/terraform-provider-xyz/provider".New
// which takes a version and produces a factory function. The provider you are bridging may
// not do that. You will need to find the function (generally called in upstream's main.go)
// that produces a:
//
// - *"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema".Provider (for SDKv2)
// - *"github.com/hashicorp/terraform-plugin-sdk/v1/helper/schema".Provider (for SDKv1)
// - "github.com/hashicorp/terraform-plugin-framework/provider".Provider (for plugin-framework)
//
//nolint:lll
P: shimv2.NewProvider(xyz.New(version.Version)()),
Name: "xyz",
Version: version.Version,
// DisplayName is a way to be able to change the casing of the provider name when being
// displayed on the Pulumi registry
DisplayName: "",
// Change this to your personal name (or a company name) that you would like to be shown in
// the Pulumi Registry if this package is published there.
Publisher: "Pulumi",
// LogoURL is optional but useful to help identify your package in the Pulumi Registry
// if this package is published there.
//
// You may host a logo on a domain you control or add an PNG logo (100x100) for your package
// in your repository and use the raw content URL for that file as your logo URL.
LogoURL: "",
// PluginDownloadURL is an optional URL used to download the Provider
// for use in Pulumi programs
// e.g. https://github.com/org/pulumi-provider-name/releases/download/v${VERSION}/
PluginDownloadURL: "",
Description: "A Pulumi package for creating and managing xyz cloud resources.",
// category/cloud tag helps with categorizing the package in the Pulumi Registry.
// For all available categories, see `Keywords` in
// https://www.pulumi.com/docs/guides/pulumi-packages/schema/#package.
Keywords: []string{"xyz", "category/cloud"},
License: "Apache-2.0",
Homepage: "https://www.pulumi.com",
Repository: "https://github.com/pulumi/pulumi-xyz",
// The GitHub Org for the provider - defaults to `terraform-providers`. Note that this should
// match the TF provider module's require directive, not any replace directives.
GitHubOrg: "",
MetadataInfo: tfbridge.NewProviderMetadata(metadata),
Config: map[string]*tfbridge.SchemaInfo{
// Add any required configuration here, or remove the example below if
// no additional points are required.
"region": {
Type: "xyz:region/region:Region",
},
},
// If extra types are needed for configuration, they can be added here.
ExtraTypes: map[string]schema.ComplexTypeSpec{
"xyz:region/region:Region": {
ObjectTypeSpec: schema.ObjectTypeSpec{
Type: "string",
},
Enum: []schema.EnumValueSpec{
{Name: "here", Value: "HERE"},
{Name: "overThere", Value: "OVER_THERE"},
},
},
},
JavaScript: &tfbridge.JavaScriptInfo{
// RespectSchemaVersion ensures the SDK is generated linking to the correct version of the provider.
RespectSchemaVersion: true,
},
Python: &tfbridge.PythonInfo{
// RespectSchemaVersion ensures the SDK is generated linking to the correct version of the provider.
RespectSchemaVersion: true,
// Enable modern PyProject support in the generated Python SDK.
PyProject: struct{ Enabled bool }{true},
},
Golang: &tfbridge.GolangInfo{
// Set where the SDK is going to be published to.
ImportBasePath: path.Join(
"github.com/pulumi/pulumi-xyz/sdk/",
tfbridge.GetModuleMajorVersion(version.Version),
"go",
mainPkg,
),
// Opt in to all available code generation features.
GenerateResourceContainerTypes: true,
GenerateExtraInputTypes: true,
// RespectSchemaVersion ensures the SDK is generated linking to the correct version of the provider.
RespectSchemaVersion: true,
},
CSharp: &tfbridge.CSharpInfo{
// RespectSchemaVersion ensures the SDK is generated linking to the correct version of the provider.
RespectSchemaVersion: true,
// Use a wildcard import so NuGet will prefer the latest possible version.
PackageReferences: map[string]string{
"Pulumi": "3.*",
},
},
}
// MustComputeTokens maps all resources and datasources from the upstream provider into Pulumi.
//
// tokens.SingleModule puts every upstream item into your provider's main module.
//
// You shouldn't need to override anything, but if you do, use the [tfbridge.ProviderInfo.Resources]
// and [tfbridge.ProviderInfo.DataSources].
prov.MustComputeTokens(tokens.SingleModule("xyz_", mainMod,
tokens.MakeStandard(mainPkg)))
prov.MustApplyAutoAliases()
prov.SetAutonaming(255, "-")
return prov
}