tfbridge

package
v0.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 41 Imported by: 148

Documentation

Overview

Package tfbridge implements adapters for constructing Pulumi Resource Providers from Terraform providers built with the Terraform Plugin Framework.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(ctx context.Context, pkg string, prov tfbridge.ProviderInfo, meta ProviderMetadata)

Implements main() or a bridged Pulumi plugin, complete with argument parsing.

info.P must be constructed with ShimProvider or ShimProviderWithContext.

func MainWithMuxer added in v0.7.1

func MainWithMuxer(ctx context.Context, pkg string, info tfbridge.ProviderInfo, schema []byte)

Implements main() or a bridged Pulumi plugin, complete with argument parsing.

This is an experimental API.

func MakeMuxedServer added in v0.7.1

func MakeMuxedServer(
	ctx context.Context, pkg string, info tfbridge.ProviderInfo, schema []byte,
) func(host *rprovider.HostClient) (pulumirpc.ResourceProviderServer, error)

Create a function to produce a Muxed provider.

This function exposes implementation details for testing. It should not be used outside of pulumi-terraform-bridge. This is an experimental API.

func MuxShimWithDisjointgPF added in v0.9.0

func MuxShimWithDisjointgPF(ctx context.Context, shim shim.Provider, p pfprovider.Provider) shim.Provider

MuxShimWithDisjointgPF initializes a shim.Provider that will server resources from both shim and p.

This function will panic if shim and p both define the same token.

To create a muxed provider, ProviderInfo.P must be the result of this function.

func MuxShimWithPF added in v0.7.1

func MuxShimWithPF(ctx context.Context, shim shim.Provider, p pfprovider.Provider) shim.Provider

MuxShimWithPF initializes a shim.Provider that will server resources from both shim and p.

If shim and p both define the same token, then the value from shim will be used.

To create a muxed provider, ProviderInfo.P must be the result of this function.

func NewProvider

func NewProvider(ctx context.Context, info tfbridge.ProviderInfo, meta ProviderMetadata) (plugin.Provider, error)

Adapts a provider to Pulumi. Most users do not need to call this directly but instead use Main to build a fully functional binary.

info.P must be constructed with ShimProvider or ShimProviderWithContext.

func NewProviderServer added in v0.9.0

func NewProviderServer(
	ctx context.Context,
	logSink logging.Sink,
	info tfbridge.ProviderInfo,
	meta ProviderMetadata,
) (pulumirpc.ResourceProviderServer, error)

Internal. The signature of this function can change between major releases. Exposed to facilitate testing.

func SchemaOnlyPluginFrameworkProvider deprecated added in v0.7.1

func SchemaOnlyPluginFrameworkProvider(ctx context.Context, p pfprovider.Provider) shim.Provider

Wrap a PF Provider in a shim.Provider.

Deprecated: This function has been renamed ShimProviderWithContext.

func ShimProvider added in v0.9.3

func ShimProvider(p pfprovider.Provider) shim.Provider

Wrap a PF Provider in a shim.Provider.

func ShimProviderWithContext added in v0.9.3

func ShimProviderWithContext(ctx context.Context, p pfprovider.Provider) shim.Provider

Wrap a PF Provider in a shim.Provider with the given context.Context.

Types

type ProviderMetadata

type ProviderMetadata struct {
	// JSON-serialzed Pulumi Package Schema.
	PackageSchema []byte

	// Deprecated. This field is no longer in use and will be removed in future versions.
	BridgeMetadata []byte
}

Defines bridged provider metadata that is pre-computed at build time with tfgen (tfgen ("github.com/pulumi/pulumi-terraform-bridge/pf/tfgen") and typically made available to the provider binary at runtime with embed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL