v1.2.0 Latest Latest

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

Go to latest
Published: Mar 19, 2024 License: MPL-2.0 Imports: 30 Imported by: 13




View Source
const (
	StateVersion = 4


This section is empty.


func FuncMap added in v0.0.12

func FuncMap(ctx context.Context, 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(ctx context.Context, 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(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.


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) 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