tfstate

package
Version: v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MPL-2.0 Imports: 30 Imported by: 7

Documentation

Index

Constants

View Source
const (
	StateVersion = 4
)

Variables

This section is empty.

Functions

func FuncMap added in v0.0.12

func FuncMap(stateLoc string) (template.FuncMap, error)

FuncMap provides a tamplate.FuncMap tfstate based on URL and provide

func FuncMapWithName added in v0.0.12

func FuncMapWithName(name string, stateLoc string) (template.FuncMap, error)

FuncMapWithName provides a tamplate.FuncMap. can lockup values from tfstate.

func MustFuncMap added in v0.0.12

func MustFuncMap(stateLoc string) template.FuncMap

MustFuncMap is similar to FuncMap, but panics if it cannot get and parse tfstate.

func MustFuncMapWithName added in v0.0.12

func MustFuncMapWithName(name string, stateLoc string) template.FuncMap

MustFuncMapWithName is similar to FuncMapWithName, but panics if it cannot get and parse tfstate.

Types

type Object added in v0.0.2

type Object struct {
	Value interface{}
}

func (Object) Bytes added in v0.0.8

func (a Object) Bytes() []byte

func (*Object) Query added in v0.0.2

func (a *Object) Query(query string) (*Object, error)

Query queries object by go-jq

func (Object) String added in v0.0.2

func (a Object) String() string

type TFState

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

TFState represents a tfstate

func Read

func Read(src io.Reader) (*TFState, error)

Read reads a tfstate from io.Reader

func ReadFile added in v0.0.3

func ReadFile(file string) (*TFState, error)

ReadFile reads terraform.tfstate from the file (a workspace reads from environment file in the same directory)

func ReadURL added in v0.1.0

func ReadURL(loc string) (*TFState, error)

ReadURL reads terraform.tfstate from the URL.

func ReadWithWorkspace added in v0.0.3

func ReadWithWorkspace(src io.Reader, ws string) (*TFState, error)

ReadWithWorkspace reads a tfstate from io.Reader with workspace

func (*TFState) List added in v0.0.5

func (s *TFState) List() ([]string, error)

List lists resource and output names in tfstate

func (*TFState) Lookup

func (s *TFState) Lookup(key string) (*Object, error)

Lookup lookups attributes of the specified key in tfstate

Jump to

Keyboard shortcuts

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