Documentation ¶
Index ¶
- Constants
- Variables
- func Client(m discovery.PluginMeta) *plugin.Client
- func ClientConfig(m discovery.PluginMeta) *plugin.ClientConfig
- func Serve(opts *ServeOpts)
- type GRPCProvider
- func (p *GRPCProvider) ApplyResourceChange(r providers.ApplyResourceChangeRequest) (resp providers.ApplyResourceChangeResponse)
- func (p *GRPCProvider) Close() error
- func (p *GRPCProvider) Configure(r providers.ConfigureRequest) (resp providers.ConfigureResponse)
- func (p *GRPCProvider) GetSchema() (resp providers.GetSchemaResponse)
- func (p *GRPCProvider) ImportResourceState(r providers.ImportResourceStateRequest) (resp providers.ImportResourceStateResponse)
- func (p *GRPCProvider) PlanResourceChange(r providers.PlanResourceChangeRequest) (resp providers.PlanResourceChangeResponse)
- func (p *GRPCProvider) PrepareProviderConfig(r providers.PrepareProviderConfigRequest) (resp providers.PrepareProviderConfigResponse)
- func (p *GRPCProvider) ReadDataSource(r providers.ReadDataSourceRequest) (resp providers.ReadDataSourceResponse)
- func (p *GRPCProvider) ReadResource(r providers.ReadResourceRequest) (resp providers.ReadResourceResponse)
- func (p *GRPCProvider) Stop() error
- func (p *GRPCProvider) UpgradeResourceState(r providers.UpgradeResourceStateRequest) (resp providers.UpgradeResourceStateResponse)
- func (p *GRPCProvider) ValidateDataSourceConfig(r providers.ValidateDataSourceConfigRequest) (resp providers.ValidateDataSourceConfigResponse)
- func (p *GRPCProvider) ValidateResourceTypeConfig(r providers.ValidateResourceTypeConfigRequest) (resp providers.ValidateResourceTypeConfigResponse)
- type GRPCProviderFunc
- type GRPCProviderPlugin
- type GRPCProvisioner
- func (p *GRPCProvisioner) Close() error
- func (p *GRPCProvisioner) GetSchema() (resp provisioners.GetSchemaResponse)
- func (p *GRPCProvisioner) ProvisionResource(r provisioners.ProvisionResourceRequest) (resp provisioners.ProvisionResourceResponse)
- func (p *GRPCProvisioner) Stop() error
- func (p *GRPCProvisioner) ValidateProvisionerConfig(r provisioners.ValidateProvisionerConfigRequest) (resp provisioners.ValidateProvisionerConfigResponse)
- type GRPCProvisionerPlugin
- type ProviderFunc
- type ResourceProvider
- func (p *ResourceProvider) Apply(info *terraform.InstanceInfo, s *terraform.InstanceState, ...) (*terraform.InstanceState, error)
- func (p *ResourceProvider) Close() error
- func (p *ResourceProvider) Configure(c *terraform.ResourceConfig) error
- func (p *ResourceProvider) DataSources() []terraform.DataSource
- func (p *ResourceProvider) Diff(info *terraform.InstanceInfo, s *terraform.InstanceState, ...) (*terraform.InstanceDiff, error)
- func (p *ResourceProvider) GetSchema(req *terraform.ProviderSchemaRequest) (*terraform.ProviderSchema, error)
- func (p *ResourceProvider) ImportState(info *terraform.InstanceInfo, id string) ([]*terraform.InstanceState, error)
- func (p *ResourceProvider) Input(input terraform.UIInput, c *terraform.ResourceConfig) (*terraform.ResourceConfig, error)
- func (p *ResourceProvider) ReadDataApply(info *terraform.InstanceInfo, d *terraform.InstanceDiff) (*terraform.InstanceState, error)
- func (p *ResourceProvider) ReadDataDiff(info *terraform.InstanceInfo, c *terraform.ResourceConfig) (*terraform.InstanceDiff, error)
- func (p *ResourceProvider) Refresh(info *terraform.InstanceInfo, s *terraform.InstanceState) (*terraform.InstanceState, error)
- func (p *ResourceProvider) Resources() []terraform.ResourceType
- func (p *ResourceProvider) Stop() error
- func (p *ResourceProvider) Validate(c *terraform.ResourceConfig) ([]string, []error)
- func (p *ResourceProvider) ValidateDataSource(t string, c *terraform.ResourceConfig) ([]string, []error)
- func (p *ResourceProvider) ValidateResource(t string, c *terraform.ResourceConfig) ([]string, []error)
- type ResourceProviderApplyArgs
- type ResourceProviderApplyResponse
- type ResourceProviderConfigureResponse
- type ResourceProviderDiffArgs
- type ResourceProviderDiffResponse
- type ResourceProviderGetSchemaArgs
- type ResourceProviderGetSchemaResponse
- type ResourceProviderImportStateArgs
- type ResourceProviderImportStateResponse
- type ResourceProviderInputArgs
- type ResourceProviderInputResponse
- type ResourceProviderPlugin
- type ResourceProviderReadDataApplyArgs
- type ResourceProviderReadDataApplyResponse
- type ResourceProviderReadDataDiffArgs
- type ResourceProviderReadDataDiffResponse
- type ResourceProviderRefreshArgs
- type ResourceProviderRefreshResponse
- type ResourceProviderServer
- func (s *ResourceProviderServer) Apply(args *ResourceProviderApplyArgs, result *ResourceProviderApplyResponse) error
- func (s *ResourceProviderServer) Configure(config *terraform.ResourceConfig, reply *ResourceProviderConfigureResponse) error
- func (s *ResourceProviderServer) DataSources(nothing interface{}, result *[]terraform.DataSource) error
- func (s *ResourceProviderServer) Diff(args *ResourceProviderDiffArgs, result *ResourceProviderDiffResponse) error
- func (s *ResourceProviderServer) GetSchema(args *ResourceProviderGetSchemaArgs, result *ResourceProviderGetSchemaResponse) error
- func (s *ResourceProviderServer) ImportState(args *ResourceProviderImportStateArgs, ...) error
- func (s *ResourceProviderServer) Input(args *ResourceProviderInputArgs, reply *ResourceProviderInputResponse) error
- func (s *ResourceProviderServer) ReadDataApply(args *ResourceProviderReadDataApplyArgs, ...) error
- func (s *ResourceProviderServer) ReadDataDiff(args *ResourceProviderReadDataDiffArgs, ...) error
- func (s *ResourceProviderServer) Refresh(args *ResourceProviderRefreshArgs, result *ResourceProviderRefreshResponse) error
- func (s *ResourceProviderServer) Resources(nothing interface{}, result *[]terraform.ResourceType) error
- func (s *ResourceProviderServer) Stop(_ interface{}, reply *ResourceProviderStopResponse) error
- func (s *ResourceProviderServer) Validate(args *ResourceProviderValidateArgs, reply *ResourceProviderValidateResponse) error
- func (s *ResourceProviderServer) ValidateDataSource(args *ResourceProviderValidateResourceArgs, ...) error
- func (s *ResourceProviderServer) ValidateResource(args *ResourceProviderValidateResourceArgs, ...) error
- type ResourceProviderStopResponse
- type ResourceProviderValidateArgs
- type ResourceProviderValidateResourceArgs
- type ResourceProviderValidateResourceResponse
- type ResourceProviderValidateResponse
- type ServeOpts
- type UIInput
- type UIInputInputResponse
- type UIInputServer
- type UIOutput
- type UIOutputServer
Constants ¶
const ( // The constants below are the names of the plugins that can be dispensed // from the plugin server. ProviderPluginName = "provider" // DefaultProtocolVersion is the protocol version assumed for legacy clients that don't specify // a particular version during their handshake. This is the version used when Terraform 0.10 // and 0.11 launch plugins that were built with support for both versions 4 and 5, and must // stay unchanged at 4 until we intentionally build plugins that are not compatible with 0.10 and // 0.11. DefaultProtocolVersion = 4 )
Variables ¶
var Handshake = plugin.HandshakeConfig{ ProtocolVersion: DefaultProtocolVersion, MagicCookieKey: "TF_PLUGIN_MAGIC_COOKIE", MagicCookieValue: "d602bf8f470bc67ca7faa0386276bbdd4330efaf76d1a219cb4d6991ca9872b2", }
Handshake is the HandshakeConfig used to configure clients and servers.
var VersionedPlugins = map[int]plugin.PluginSet{ 5: { "provider": &GRPCProviderPlugin{}, "provisioner": &GRPCProvisionerPlugin{}, }, }
Functions ¶
func Client ¶
func Client(m discovery.PluginMeta) *plugin.Client
Client returns a plugin client for the plugin described by the given metadata.
func ClientConfig ¶
func ClientConfig(m discovery.PluginMeta) *plugin.ClientConfig
ClientConfig returns a configuration object that can be used to instantiate a client for the plugin described by the given metadata.
Types ¶
type GRPCProvider ¶
type GRPCProvider struct { // PluginClient provides a reference to the plugin.Client which controls the plugin process. // This allows the GRPCProvider a way to shutdown the plugin process. PluginClient *plugin.Client // TestServer contains a grpc.Server to close when the GRPCProvider is being // used in an end to end test of a provider. TestServer *grpc.Server // contains filtered or unexported fields }
GRPCProvider handles the client, or core side of the plugin rpc connection. The GRPCProvider methods are mostly a translation layer between the terraform provioders types and the grpc proto types, directly converting between the two.
func (*GRPCProvider) ApplyResourceChange ¶
func (p *GRPCProvider) ApplyResourceChange(r providers.ApplyResourceChangeRequest) (resp providers.ApplyResourceChangeResponse)
func (*GRPCProvider) Close ¶
func (p *GRPCProvider) Close() error
closing the grpc connection is final, and terraform will call it at the end of every phase.
func (*GRPCProvider) Configure ¶
func (p *GRPCProvider) Configure(r providers.ConfigureRequest) (resp providers.ConfigureResponse)
func (*GRPCProvider) GetSchema ¶
func (p *GRPCProvider) GetSchema() (resp providers.GetSchemaResponse)
func (*GRPCProvider) ImportResourceState ¶
func (p *GRPCProvider) ImportResourceState(r providers.ImportResourceStateRequest) (resp providers.ImportResourceStateResponse)
func (*GRPCProvider) PlanResourceChange ¶
func (p *GRPCProvider) PlanResourceChange(r providers.PlanResourceChangeRequest) (resp providers.PlanResourceChangeResponse)
func (*GRPCProvider) PrepareProviderConfig ¶
func (p *GRPCProvider) PrepareProviderConfig(r providers.PrepareProviderConfigRequest) (resp providers.PrepareProviderConfigResponse)
func (*GRPCProvider) ReadDataSource ¶
func (p *GRPCProvider) ReadDataSource(r providers.ReadDataSourceRequest) (resp providers.ReadDataSourceResponse)
func (*GRPCProvider) ReadResource ¶
func (p *GRPCProvider) ReadResource(r providers.ReadResourceRequest) (resp providers.ReadResourceResponse)
func (*GRPCProvider) Stop ¶
func (p *GRPCProvider) Stop() error
func (*GRPCProvider) UpgradeResourceState ¶
func (p *GRPCProvider) UpgradeResourceState(r providers.UpgradeResourceStateRequest) (resp providers.UpgradeResourceStateResponse)
func (*GRPCProvider) ValidateDataSourceConfig ¶
func (p *GRPCProvider) ValidateDataSourceConfig(r providers.ValidateDataSourceConfigRequest) (resp providers.ValidateDataSourceConfigResponse)
func (*GRPCProvider) ValidateResourceTypeConfig ¶
func (p *GRPCProvider) ValidateResourceTypeConfig(r providers.ValidateResourceTypeConfigRequest) (resp providers.ValidateResourceTypeConfigResponse)
type GRPCProviderFunc ¶
type GRPCProviderFunc func() proto.ProviderServer
type GRPCProviderPlugin ¶
type GRPCProviderPlugin struct { plugin.Plugin GRPCProvider func() proto.ProviderServer }
GRPCProviderPlugin implements plugin.GRPCPlugin for the go-plugin package.
func (*GRPCProviderPlugin) GRPCClient ¶
func (p *GRPCProviderPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*GRPCProviderPlugin) GRPCServer ¶
func (p *GRPCProviderPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type GRPCProvisioner ¶
type GRPCProvisioner struct { // PluginClient provides a reference to the plugin.Client which controls the plugin process. // This allows the GRPCProvider a way to shutdown the plugin process. PluginClient *plugin.Client // contains filtered or unexported fields }
provisioners.Interface grpc implementation
func (*GRPCProvisioner) Close ¶
func (p *GRPCProvisioner) Close() error
func (*GRPCProvisioner) GetSchema ¶
func (p *GRPCProvisioner) GetSchema() (resp provisioners.GetSchemaResponse)
func (*GRPCProvisioner) ProvisionResource ¶
func (p *GRPCProvisioner) ProvisionResource(r provisioners.ProvisionResourceRequest) (resp provisioners.ProvisionResourceResponse)
func (*GRPCProvisioner) Stop ¶
func (p *GRPCProvisioner) Stop() error
func (*GRPCProvisioner) ValidateProvisionerConfig ¶
func (p *GRPCProvisioner) ValidateProvisionerConfig(r provisioners.ValidateProvisionerConfigRequest) (resp provisioners.ValidateProvisionerConfigResponse)
type GRPCProvisionerPlugin ¶
type GRPCProvisionerPlugin struct { plugin.Plugin GRPCProvisioner func() proto.ProvisionerServer }
GRPCProvisionerPlugin is the plugin.GRPCPlugin implementation.
func (*GRPCProvisionerPlugin) GRPCClient ¶
func (p *GRPCProvisionerPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*GRPCProvisionerPlugin) GRPCServer ¶
func (p *GRPCProvisionerPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type ProviderFunc ¶
type ProviderFunc func() terraform.ResourceProvider
type ResourceProvider ¶
ResourceProvider is an implementation of terraform.ResourceProvider that communicates over RPC.
func (*ResourceProvider) Apply ¶
func (p *ResourceProvider) Apply( info *terraform.InstanceInfo, s *terraform.InstanceState, d *terraform.InstanceDiff) (*terraform.InstanceState, error)
func (*ResourceProvider) Close ¶
func (p *ResourceProvider) Close() error
func (*ResourceProvider) Configure ¶
func (p *ResourceProvider) Configure(c *terraform.ResourceConfig) error
func (*ResourceProvider) DataSources ¶
func (p *ResourceProvider) DataSources() []terraform.DataSource
func (*ResourceProvider) Diff ¶
func (p *ResourceProvider) Diff( info *terraform.InstanceInfo, s *terraform.InstanceState, c *terraform.ResourceConfig) (*terraform.InstanceDiff, error)
func (*ResourceProvider) GetSchema ¶
func (p *ResourceProvider) GetSchema(req *terraform.ProviderSchemaRequest) (*terraform.ProviderSchema, error)
func (*ResourceProvider) ImportState ¶
func (p *ResourceProvider) ImportState( info *terraform.InstanceInfo, id string) ([]*terraform.InstanceState, error)
func (*ResourceProvider) Input ¶
func (p *ResourceProvider) Input( input terraform.UIInput, c *terraform.ResourceConfig) (*terraform.ResourceConfig, error)
func (*ResourceProvider) ReadDataApply ¶
func (p *ResourceProvider) ReadDataApply( info *terraform.InstanceInfo, d *terraform.InstanceDiff) (*terraform.InstanceState, error)
func (*ResourceProvider) ReadDataDiff ¶
func (p *ResourceProvider) ReadDataDiff( info *terraform.InstanceInfo, c *terraform.ResourceConfig) (*terraform.InstanceDiff, error)
func (*ResourceProvider) Refresh ¶
func (p *ResourceProvider) Refresh( info *terraform.InstanceInfo, s *terraform.InstanceState) (*terraform.InstanceState, error)
func (*ResourceProvider) Resources ¶
func (p *ResourceProvider) Resources() []terraform.ResourceType
func (*ResourceProvider) Stop ¶
func (p *ResourceProvider) Stop() error
func (*ResourceProvider) Validate ¶
func (p *ResourceProvider) Validate(c *terraform.ResourceConfig) ([]string, []error)
func (*ResourceProvider) ValidateDataSource ¶
func (p *ResourceProvider) ValidateDataSource( t string, c *terraform.ResourceConfig) ([]string, []error)
func (*ResourceProvider) ValidateResource ¶
func (p *ResourceProvider) ValidateResource( t string, c *terraform.ResourceConfig) ([]string, []error)
type ResourceProviderApplyArgs ¶
type ResourceProviderApplyArgs struct { Info *terraform.InstanceInfo State *terraform.InstanceState Diff *terraform.InstanceDiff }
type ResourceProviderApplyResponse ¶
type ResourceProviderApplyResponse struct { State *terraform.InstanceState Error *plugin.BasicError }
type ResourceProviderConfigureResponse ¶
type ResourceProviderConfigureResponse struct {
Error *plugin.BasicError
}
type ResourceProviderDiffArgs ¶
type ResourceProviderDiffArgs struct { Info *terraform.InstanceInfo State *terraform.InstanceState Config *terraform.ResourceConfig }
type ResourceProviderDiffResponse ¶
type ResourceProviderDiffResponse struct { Diff *terraform.InstanceDiff Error *plugin.BasicError }
type ResourceProviderGetSchemaArgs ¶
type ResourceProviderGetSchemaArgs struct {
Req *terraform.ProviderSchemaRequest
}
type ResourceProviderGetSchemaResponse ¶
type ResourceProviderGetSchemaResponse struct { Schema *terraform.ProviderSchema Error *plugin.BasicError }
type ResourceProviderImportStateArgs ¶
type ResourceProviderImportStateArgs struct { Info *terraform.InstanceInfo Id string }
type ResourceProviderImportStateResponse ¶
type ResourceProviderImportStateResponse struct { State []*terraform.InstanceState Error *plugin.BasicError }
type ResourceProviderInputArgs ¶
type ResourceProviderInputArgs struct { InputId uint32 Config *terraform.ResourceConfig }
type ResourceProviderInputResponse ¶
type ResourceProviderInputResponse struct { Config *terraform.ResourceConfig Error *plugin.BasicError }
type ResourceProviderPlugin ¶
type ResourceProviderPlugin struct {
ResourceProvider func() terraform.ResourceProvider
}
ResourceProviderPlugin is the plugin.Plugin implementation.
func (*ResourceProviderPlugin) Client ¶
func (p *ResourceProviderPlugin) Client( b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)
func (*ResourceProviderPlugin) Server ¶
func (p *ResourceProviderPlugin) Server(b *plugin.MuxBroker) (interface{}, error)
type ResourceProviderReadDataApplyArgs ¶
type ResourceProviderReadDataApplyArgs struct { Info *terraform.InstanceInfo Diff *terraform.InstanceDiff }
type ResourceProviderReadDataApplyResponse ¶
type ResourceProviderReadDataApplyResponse struct { State *terraform.InstanceState Error *plugin.BasicError }
type ResourceProviderReadDataDiffArgs ¶
type ResourceProviderReadDataDiffArgs struct { Info *terraform.InstanceInfo Config *terraform.ResourceConfig }
type ResourceProviderReadDataDiffResponse ¶
type ResourceProviderReadDataDiffResponse struct { Diff *terraform.InstanceDiff Error *plugin.BasicError }
type ResourceProviderRefreshArgs ¶
type ResourceProviderRefreshArgs struct { Info *terraform.InstanceInfo State *terraform.InstanceState }
type ResourceProviderRefreshResponse ¶
type ResourceProviderRefreshResponse struct { State *terraform.InstanceState Error *plugin.BasicError }
type ResourceProviderServer ¶
type ResourceProviderServer struct { Broker *plugin.MuxBroker Provider terraform.ResourceProvider }
ResourceProviderServer is a net/rpc compatible structure for serving a ResourceProvider. This should not be used directly.
func (*ResourceProviderServer) Apply ¶
func (s *ResourceProviderServer) Apply( args *ResourceProviderApplyArgs, result *ResourceProviderApplyResponse) error
func (*ResourceProviderServer) Configure ¶
func (s *ResourceProviderServer) Configure( config *terraform.ResourceConfig, reply *ResourceProviderConfigureResponse) error
func (*ResourceProviderServer) DataSources ¶
func (s *ResourceProviderServer) DataSources( nothing interface{}, result *[]terraform.DataSource) error
func (*ResourceProviderServer) Diff ¶
func (s *ResourceProviderServer) Diff( args *ResourceProviderDiffArgs, result *ResourceProviderDiffResponse) error
func (*ResourceProviderServer) GetSchema ¶
func (s *ResourceProviderServer) GetSchema( args *ResourceProviderGetSchemaArgs, result *ResourceProviderGetSchemaResponse, ) error
func (*ResourceProviderServer) ImportState ¶
func (s *ResourceProviderServer) ImportState( args *ResourceProviderImportStateArgs, result *ResourceProviderImportStateResponse) error
func (*ResourceProviderServer) Input ¶
func (s *ResourceProviderServer) Input( args *ResourceProviderInputArgs, reply *ResourceProviderInputResponse) error
func (*ResourceProviderServer) ReadDataApply ¶
func (s *ResourceProviderServer) ReadDataApply( args *ResourceProviderReadDataApplyArgs, result *ResourceProviderReadDataApplyResponse) error
func (*ResourceProviderServer) ReadDataDiff ¶
func (s *ResourceProviderServer) ReadDataDiff( args *ResourceProviderReadDataDiffArgs, result *ResourceProviderReadDataDiffResponse) error
func (*ResourceProviderServer) Refresh ¶
func (s *ResourceProviderServer) Refresh( args *ResourceProviderRefreshArgs, result *ResourceProviderRefreshResponse) error
func (*ResourceProviderServer) Resources ¶
func (s *ResourceProviderServer) Resources( nothing interface{}, result *[]terraform.ResourceType) error
func (*ResourceProviderServer) Stop ¶
func (s *ResourceProviderServer) Stop( _ interface{}, reply *ResourceProviderStopResponse) error
func (*ResourceProviderServer) Validate ¶
func (s *ResourceProviderServer) Validate( args *ResourceProviderValidateArgs, reply *ResourceProviderValidateResponse) error
func (*ResourceProviderServer) ValidateDataSource ¶
func (s *ResourceProviderServer) ValidateDataSource( args *ResourceProviderValidateResourceArgs, reply *ResourceProviderValidateResourceResponse) error
func (*ResourceProviderServer) ValidateResource ¶
func (s *ResourceProviderServer) ValidateResource( args *ResourceProviderValidateResourceArgs, reply *ResourceProviderValidateResourceResponse) error
type ResourceProviderStopResponse ¶
type ResourceProviderStopResponse struct {
Error *plugin.BasicError
}
type ResourceProviderValidateArgs ¶
type ResourceProviderValidateArgs struct {
Config *terraform.ResourceConfig
}
type ResourceProviderValidateResourceArgs ¶
type ResourceProviderValidateResourceArgs struct { Config *terraform.ResourceConfig Type string }
type ResourceProviderValidateResourceResponse ¶
type ResourceProviderValidateResourceResponse struct { Warnings []string Errors []*plugin.BasicError }
type ResourceProviderValidateResponse ¶
type ResourceProviderValidateResponse struct { Warnings []string Errors []*plugin.BasicError }
type ServeOpts ¶
type ServeOpts struct { ProviderFunc ProviderFunc // Wrapped versions of the above plugins will automatically shimmed and // added to the GRPC functions when possible. GRPCProviderFunc GRPCProviderFunc }
ServeOpts are the configurations to serve a plugin.
type UIInputInputResponse ¶
type UIInputInputResponse struct { Value string Error *plugin.BasicError }
type UIInputServer ¶
UIInputServer is a net/rpc compatible structure for serving a UIInputServer. This should not be used directly.
func (*UIInputServer) Input ¶
func (s *UIInputServer) Input( opts *terraform.InputOpts, reply *UIInputInputResponse) error
type UIOutputServer ¶
UIOutputServer is the RPC server for serving UIOutput.
func (*UIOutputServer) Output ¶
func (s *UIOutputServer) Output( v string, reply *interface{}) error