terraform

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTerraformNotAvailable = fmt.Errorf("provisioner error: executable file 'terraform' not found in $PATH")

ErrTerraformNotAvailable error used when `terraform` binary in not in the path and we try to use a provisioner.

Functions

func IsTerraformBinaryAvailable added in v1.0.0

func IsTerraformBinaryAvailable() bool

IsTerraformBinaryAvailable determines if Terraform binary is available in the path of the system. Terraform binary is a requirement for executing provisioner plugins, since they are built-in on the Terrafrom binary. :(

https://github.com/hashicorp/terraform/issues/20896#issuecomment-479054649

Types

type PluginManager

type PluginManager struct {
	Path string
}

PluginManager is a wrapper around the terraform tools to download and execute terraform plugins, like providers and provisioners.

func (*PluginManager) Provider

func (m *PluginManager) Provider(provider, version string, forceLocal bool) (*plugin.Client, discovery.PluginMeta, error)

Provider returns a client and the metadata for a given provider and version, first try to locate the provider in the local path, if not found, it downloads it from terraform registry. If forceLocal just tries to find the binary in the local filesystem.

func (*PluginManager) Provisioner

func (m *PluginManager) Provisioner(provisioner string) (*plugin.Client, discovery.PluginMeta, error)

Provisioner returns a client and the metadata for a given provisioner, it try to locate it at the local Path, if not try to execute it from the built-in plugins in the terraform binary.

Jump to

Keyboard shortcuts

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