client

package
v0.0.0-...-4fe213c Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: Apache-2.0 Imports: 12 Imported by: 393

Documentation

Index

Constants

View Source
const FakeTerraformVersion string = "v0.13.5"

FakeTerraformVersion is a nice lie we tell to providers to keep them happy TODO: is there a more sane way to negotiate version compat w/ providers?

View Source
const ProviderPluginType = "provider"

Variables

View Source
var DefaultProviderPoolSize = 5

Functions

func GetProviderSchema

func GetProviderSchema(p *Provider) (*configschema.Block, error)

func NewGRPCProvider

func NewGRPCProvider(providerName, pluginPath string) (*tfplugin.GRPCProvider, error)

NewGRPCProvider creates a new GRPCClient instance.

Types

type Provider

type Provider struct {
	GRPCProvider *tfplugin.GRPCProvider
	Name         string
	Config       ProviderConfig
}

Provider wraps grpcProvider with some additional metadata like the provider name

func NewProvider

func NewProvider(providerName string, pluginPath string) (*Provider, error)

NewProvider constructs a Provider, which is a container type, holding a terraform provider plugin grpc client, as well as metadata about this provider instance, eg its configuration and type.

func (*Provider) Configure

func (p *Provider) Configure(cfg cty.Value) error

Configure calls the provider's grpc configuration interface, also translating the ProviderConfig structure to the Provider's encoded HCL representation. func (p *Provider) Configure(cfg map[string]cty.Value) error {

type ProviderConfig

type ProviderConfig struct {
	TerraformConfig cty.Value `json:"config"`
}

ProviderConfig models the on-disk yaml config for providers

func ReadProviderConfigFile

func ReadProviderConfigFile(path string) (ProviderConfig, error)

ReadProviderConfigFile reads a yaml-formatted provider config and unmarshals it into a ProviderConfig, which knows how to generate the serialized provider config that a terraform provider expects.

type ProviderPool

type ProviderPool struct {
	// contains filtered or unexported fields
}

func NewProviderPool

func NewProviderPool(initializer Initializer, ropts *RuntimeOptions) *ProviderPool

func (*ProviderPool) Borrow

func (pp *ProviderPool) Borrow(ctx context.Context, res resource.Managed, kube kubeclient.Client) (*Provider, error)

func (*ProviderPool) Return

func (pp *ProviderPool) Return(p *Provider)

type RuntimeOptions

type RuntimeOptions struct {
	PoolSize   int
	PluginPath string
}

func NewRuntimeOptions

func NewRuntimeOptions() *RuntimeOptions

func (*RuntimeOptions) WithPluginPath

func (ro *RuntimeOptions) WithPluginPath(path string) *RuntimeOptions

func (*RuntimeOptions) WithPoolSize

func (ro *RuntimeOptions) WithPoolSize(size int) *RuntimeOptions

Jump to

Keyboard shortcuts

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