Documentation ¶
Overview ¶
Package tfbridge implements adapters for constructing Pulumi Resource Providers from Terraform providers built with the Terraform Plugin Framework.
Index ¶
- func Main(ctx context.Context, pkg string, prov tfbridge.ProviderInfo, ...)
- func MainWithMuxer(ctx context.Context, pkg string, info tfbridge.ProviderInfo, schema []byte)
- func MakeMuxedServer(ctx context.Context, pkg string, info tfbridge.ProviderInfo, schema []byte) func(host *rprovider.HostClient) (pulumirpc.ResourceProviderServer, error)
- func MuxShimWithDisjointgPF(ctx context.Context, shim shim.Provider, p pfprovider.Provider) shim.Provider
- func MuxShimWithPF(ctx context.Context, shim shim.Provider, p pfprovider.Provider) shim.Provider
- func NewMuxProvider(ctx context.Context, providerInfo info.Provider, meta *ProviderMetadata) (info.MuxProvider, error)
- func NewProvider(ctx context.Context, info tfbridge.ProviderInfo, meta ProviderMetadata) (plugin.Provider, error)
- func NewProviderServer(ctx context.Context, logSink logging.Sink, info tfbridge.ProviderInfo, ...) (pulumirpc.ResourceProviderServer, error)
- func SchemaOnlyPluginFrameworkProvider(ctx context.Context, p pfprovider.Provider) shim.Providerdeprecated
- func ShimProvider(p pfprovider.Provider) shim.Provider
- func ShimProviderWithContext(ctx context.Context, p pfprovider.Provider) shim.Provider
- func XParameterizeResetProvider(ctx context.Context, info tfbridge.ProviderInfo, meta ProviderMetadata) error
- type ProviderMetadata
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 ¶
Implements main() or a bridged Pulumi plugin, complete with argument parsing.
This is an experimental API.
func MakeMuxedServer ¶
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 ¶
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 ¶
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 NewMuxProvider ¶
func NewMuxProvider(ctx context.Context, providerInfo info.Provider, meta *ProviderMetadata) (info.MuxProvider, error)
Adapts a provider to be usable as a mix-in, see info.Provider.MuxWith.
info.P must be constructed with ShimProvider or ShimProviderWithContext.
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 ¶
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
func ShimProvider ¶
func ShimProvider(p pfprovider.Provider) shim.Provider
Wrap a PF Provider in a shim.Provider.
func ShimProviderWithContext ¶
Wrap a PF Provider in a shim.Provider with the given context.Context.
func XParameterizeResetProvider ¶
func XParameterizeResetProvider(ctx context.Context, info tfbridge.ProviderInfo, meta ProviderMetadata) error
XParameterizeResetProvider resets the enclosing PF provider with a new info and meta combination.
XParameterizeResetProvider is an unstable method and may change in any bridge release. It is intended only for internal use.
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 // XParamaterize overrides the functionality of the Paramaterize call. // // XParamaterize is an experimental API and should not be used by 3rd parties. It // does not have a backwards compatibility guarantee and may be removed in the // future. XParamaterize func(context.Context, plugin.ParameterizeRequest) (plugin.ParameterizeResponse, error) // XGetSchema overrides the functionality of the GetSchema call. Either XGetSchema // or PackageSchema must be set. If both are set, then the provider will panic // during startup. // // XGetSchema is an experimental API and should not be used by 3rd parties. It // does not have a backwards compatibility guarantee and may be removed in the // future. XGetSchema func(context.Context, plugin.GetSchemaRequest) ([]byte, error) }
Defines bridged provider metadata that is pre-computed at build time with tfgen (tfgen ("github.com/pulumi/pulumi-terraform-bridge/v3/pf/tfgen") and typically made available to the provider binary at runtime with embed.
Source Files ¶
- detect_check_failures.go
- dynamic_value.go
- extend.go
- ids.go
- logging.go
- main.go
- metadata.go
- naming.go
- package.go
- provider.go
- provider_attach.go
- provider_check.go
- provider_checkconfig.go
- provider_configure.go
- provider_create.go
- provider_datasources.go
- provider_delete.go
- provider_diagnostics.go
- provider_diff.go
- provider_diffconfig.go
- provider_get_mapping.go
- provider_invoke.go
- provider_mux.go
- provider_plan.go
- provider_read.go
- provider_resources.go
- provider_streaminvoke.go
- provider_update.go
- provider_upgrade_resource_state.go
- resource_state.go
- serve.go