tfstate

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: MPL-2.0 Imports: 31 Imported by: 14

Documentation

Index

Constants

View Source
const (
	StateVersion = 4
)

Variables

This section is empty.

Functions

func FuncMap added in v0.0.12

func FuncMap(ctx context.Context, stateLoc string) (template.FuncMap, error)

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

func FuncMapWithName added in v0.0.12

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

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

func JsonnetNativeFuncs added in v1.3.0

func JsonnetNativeFuncs(ctx context.Context, prefix, stateLoc string) ([]*jsonnet.NativeFunction, error)

JsonnetNativeFuncs provides the native functions for go-jsonnet.

func MustFuncMap added in v0.0.12

func MustFuncMap(ctx context.Context, 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(ctx context.Context, 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(ctx context.Context, src io.Reader) (*TFState, error)

Read reads a tfstate from io.Reader

func ReadFile added in v0.0.3

func ReadFile(ctx context.Context, 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(ctx context.Context, loc string) (*TFState, error)

ReadURL reads terraform.tfstate from the URL.

func ReadWithWorkspace added in v0.0.3

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

ReadWithWorkspace reads a tfstate from io.Reader with workspace

func (*TFState) FuncMap added in v1.3.2

func (s *TFState) FuncMap(ctx context.Context) template.FuncMap

func (*TFState) FuncMapWithName added in v1.3.2

func (s *TFState) FuncMapWithName(ctx context.Context, name string) template.FuncMap

func (*TFState) JsonnetNativeFuncs added in v1.3.2

func (s *TFState) JsonnetNativeFuncs(ctx context.Context) []*jsonnet.NativeFunction

TFState provides a tfstate.

func (*TFState) JsonnetNativeFuncsWithPrefix added in v1.3.2

func (s *TFState) JsonnetNativeFuncsWithPrefix(ctx context.Context, prefix string) []*jsonnet.NativeFunction

JsonnetNativeFuncsWithPrefix provides the native functions for go-jsonnet with prefix.

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