client

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHostname = "app.terraform.io"
)

Variables

View Source
var (
	ErrMissingAuthToken = errors.New("required token could not be found. Please set the token using an input variable in the provider configuration block or by using the TFE_TOKEN environment variable")
)
View Source
var (
	// TFEUserAgent is the user agent string sent with all requests made by the provider
	TFEUserAgent = fmt.Sprintf("terraform-provider-tfe/%s", providerVersion.ProviderVersion)
)

Functions

func CheckConstraints

func CheckConstraints(c *disco.Constraints) error

CheckConstraints checks service version constrains against our own version and returns rich and informational diagnostics in case any incompatibilities are detected.

func GetClient

func GetClient(tfeHost, token string, insecure bool) (*tfe.Client, error)

GetClient encapsulates the logic for configuring a go-tfe client instance for the provider, including fallback to values from environment variables. This is useful because we're muxing multiple provider servers together and each one needs an identically configured client.

Internally, this function caches configured clients using the specified parameters

Types

type CLIHostConfig

type CLIHostConfig struct {
	Hosts       map[string]*ConfigHost `hcl:"host"`
	Credentials CredentialsMap         `hcl:"credentials"`
}

CLIHostConfig is the structure of the configuration for the Terraform CLI.

type ClientConfigMap

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

func (*ClientConfigMap) GetByConfig

func (c *ClientConfigMap) GetByConfig(config *ClientConfiguration) *tfe.Client

func (*ClientConfigMap) Lock

func (c *ClientConfigMap) Lock()

func (*ClientConfigMap) Set

func (c *ClientConfigMap) Set(client *tfe.Client, config *ClientConfiguration)

func (*ClientConfigMap) Unlock

func (c *ClientConfigMap) Unlock()

type ClientConfiguration

type ClientConfiguration struct {
	Services   *disco.Disco
	HTTPClient *http.Client
	TFEHost    svchost.Hostname
	Token      string
	Insecure   bool
}

ClientConfiguration is the refined information needed to configure a tfe.Client

func (ClientConfiguration) Key

func (c ClientConfiguration) Key() string

Key returns a string that is comparable to other ClientConfiguration values

type ConfigHost

type ConfigHost struct {
	Services map[string]interface{} `hcl:"services"`
}

ConfigHost is the structure of the "host" nested block within the CLI configuration, which can be used to override the default service host discovery behavior for a particular hostname.

type CredentialsMap

type CredentialsMap map[string]map[string]interface{}

Jump to

Keyboard shortcuts

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