Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Library ¶
type Library interface {
NewProviderManager() ProviderManager
NewProvisionerManager() ProvisionerManager
HasProvider(addr addrs.Provider) bool
HasProvisioner(typ string) bool
}
Library represents a suite of provider and provisioner plugins. It does not expose much functionality itself, instead serving as a starting point for the more complex managers.
func NewLibrary ¶
func NewLibrary(providerFactories ProviderFactories, provisionerFactories ProvisionerFactories) Library
type ProviderFactories ¶
func (ProviderFactories) HasProvider ¶
func (p ProviderFactories) HasProvider(addr addrs.Provider) bool
func (ProviderFactories) NewInstance ¶
type ProviderManager ¶
type ProviderManager interface {
// HasProvider checks to see if the underlying library contains a given provider.
HasProvider(addr addrs.Provider) bool
// GetProviderSchema returns a fully validated and cached provider schema. This should
// always be preferred to accessing the schema directly from a provider.
GetProviderSchema(ctx context.Context, addr addrs.Provider) (providers.ProviderSchema, tfdiags.Diagnostics)
// NewProvider starts and tracks a new provider instance of the given type.
NewProvider(ctx context.Context, addr addrs.Provider) (providers.Interface, tfdiags.Diagnostics)
// NewConfiguredProvider starts, configures, and tracks a new provider instance of the give type.
NewConfiguredProvider(ctx context.Context, addr addrs.Provider, cfgVal cty.Value) (providers.Configured, tfdiags.Diagnostics)
// StopAll gracefully requests all tracked providers to stop.
// See [providers.Unconfigured.Stop] for more information.
StopAll(context.Context) error
// CloseAll forcefully closes all tracked providers.
// See [providers.Unconfigured.Close] for more information.
// See cmd/ghoten/main.go:plugin.CleanupClients for the fallback.
CloseAll(context.Context) error
// Shutdown locks the provider manager in a Shutdown state and calls CloseAll,
// preventing any further usage of this object.
Shutdown(context.Context) error
}
ProviderManager allows for spawning, tracking and management of provider instances.
type ProvisionerFactories ¶
type ProvisionerFactories map[string]provisioners.Factory
func (ProvisionerFactories) HasProvisioner ¶
func (p ProvisionerFactories) HasProvisioner(typ string) bool
func (ProvisionerFactories) NewInstance ¶
func (p ProvisionerFactories) NewInstance(typ string) (provisioners.Interface, error)
type ProvisionerManager ¶
type ProvisionerManager interface {
// HasProvisioner checks to see if the underlying library contains a given provisioner.
HasProvisioner(typ string) bool
// ProvisionerSchema is a caching wrapper for [provisioners.Interface.GetSchema]
ProvisionerSchema(typ string) (*configschema.Block, error)
// [provisioners.Interface.ValidateProvisionerConfig]
ValidateProvisionerConfig(ctx context.Context, typ string, config cty.Value) tfdiags.Diagnostics
// [provisioners.Interface.ProvisionResource]
ProvisionResource(ctx context.Context, typ string, config cty.Value, connection cty.Value, output provisioners.UIOutput) tfdiags.Diagnostics
// StopAll gracefully requests all tracked provisioners to stop.
// See [provisioners.Interface.Stop] for more information.
StopAll() error
// CloseAll forcefully closes all tracked provisioners.
// See [provisioners.Interface.Close] for more information.
// See cmd/ghoten/main.go:plugin.CleanupClients for the fallback.
CloseAll() error
// Shutdown locks the provisioner manager in a Shutdown state and calls CloseAll,
// preventing any further usage of this object.
Shutdown() error
}
ProvisionerManager exposes provisioner functionality through functions, instead of providing access to the provisioner instances themselves.
Click to show internal directories.
Click to hide internal directories.