client

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateVersion = 4
)

Variables

This section is empty.

Functions

func BackendMultiplex

func BackendMultiplex(meta schema.ClientMeta) []schema.ClientMeta

BackendMultiplex add the ability to handle multiple backends in the same fetch

func Configure

func Configure(logger hclog.Logger, providerConfig interface{}) (schema.ClientMeta, diag.Diagnostics)

func DeleteLineageSerialFilter

func DeleteLineageSerialFilter(meta schema.ClientMeta, parent *schema.Resource) []interface{}

DeleteLineageSerialFilter will delete duplicate fetches

Types

type BackendConfigBlock

type BackendConfigBlock struct {
	BackendName string                 `yaml:"name"`
	BackendType string                 `yaml:"backend"`
	ConfigAttrs map[string]interface{} `yaml:",inline"`
}

BackendConfigBlock - abstract backend config

type BackendType

type BackendType string
const (
	LOCAL BackendType = "local"
	S3    BackendType = "s3"
)

currently supported backends type full list - https://www.terraform.io/docs/language/settings/backends/index.html

type Client

type Client struct {
	Backends map[string]*TerraformBackend

	// CurrentBackend set by client multiplexer
	CurrentBackend string
	// contains filtered or unexported fields
}

func NewTerraformClient

func NewTerraformClient(logger hclog.Logger, backends map[string]*TerraformBackend) Client

func (*Client) Backend

func (c *Client) Backend() *TerraformBackend

func (*Client) Logger

func (c *Client) Logger() hclog.Logger

type Config

type Config struct {
	Config []BackendConfigBlock `yaml:"config"`
}

func (Config) Example

func (Config) Example() string

type Instance

type Instance struct {
	IndexKey interface{} `json:"index_key,omitempty"`
	Status   string      `json:"status,omitempty"`
	Deposed  string      `json:"deposed,omitempty"`

	SchemaVersion           uint64            `json:"schema_version"`
	AttributesRaw           json.RawMessage   `json:"attributes,omitempty"`
	AttributesFlat          map[string]string `json:"attributes_flat,omitempty"`
	AttributeSensitivePaths json.RawMessage   `json:"sensitive_attributes,omitempty"`

	PrivateRaw []byte `json:"private,omitempty"`

	Dependencies []string `json:"dependencies,omitempty"`

	CreateBeforeDestroy bool `json:"create_before_destroy,omitempty"`
}

type LocalBackendConfig

type LocalBackendConfig struct {
	Path string `yaml:"path"`
}

type OutputState

type OutputState struct {
	ValueRaw     json.RawMessage `json:"value"`
	ValueTypeRaw json.RawMessage `json:"type"`
	Sensitive    bool            `json:"sensitive,omitempty"`
}

type Resource

type Resource struct {
	Module         string     `json:"module,omitempty"`
	Mode           string     `json:"mode"`
	Type           string     `json:"type"`
	Name           string     `json:"name"`
	EachMode       string     `json:"each,omitempty"`
	ProviderConfig string     `json:"provider"`
	Instances      []Instance `json:"instances"`
}

type S3BackendConfig

type S3BackendConfig struct {
	Bucket  string `yaml:"bucket"`
	Key     string `yaml:"key"`
	Region  string `yaml:"region"`
	RoleArn string `yaml:"role_arn,omitempty"`
}

type State

type State struct {
	Version          uint64                 `json:"version"`
	TerraformVersion string                 `json:"terraform_version"`
	Serial           uint64                 `json:"serial"`
	Lineage          string                 `json:"lineage"`
	RootOutputs      map[string]OutputState `json:"outputs"`
	Resources        []Resource             `json:"resources"`
}

type TerraformBackend

type TerraformBackend struct {
	BackendType BackendType
	BackendName string
	Data        *TerraformData
}

func NewBackend

func NewBackend(cfg *BackendConfigBlock) (*TerraformBackend, error)

NewBackend initialize function

func NewLocalTerraformBackend

func NewLocalTerraformBackend(config *BackendConfigBlock) (*TerraformBackend, error)

func NewS3TerraformBackend

func NewS3TerraformBackend(config *BackendConfigBlock) (*TerraformBackend, error)

type TerraformData

type TerraformData struct {
	State State
}

Jump to

Keyboard shortcuts

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