Thanks to visit codestin.com
Credit goes to pkg.go.dev

tfparse

package
v2.21.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildEvalContext added in v2.18.2

func BuildEvalContext(vars map[string]string, params map[string]string) *hcl.EvalContext

BuildEvalContext builds an evaluation context for the given variable and parameter defaults.

func CtyValueString added in v2.18.2

func CtyValueString(val cty.Value) (string, error)

CtyValueString converts a cty.Value to a string. It supports only primitive types - bool, number, and string. As a special case, it also supports map[string]interface{} with key "value".

func Functions added in v2.18.5

func Functions() map[string]function.Function

Functions returns a set of functions that are safe to use in the context of evaluating Terraform expressions without any ability to reference local files. Functions that refer to file operations are replaced with stubs that return a descriptive error to the user.

func WriteArchive added in v2.18.0

func WriteArchive(bs []byte, mimetype string, path string) error

WriteArchive is a helper function to write a in-memory archive with the given mimetype to disk. Only zip and tar archives are currently supported.

Types

type Option added in v2.18.0

type Option func(*Parser)

Option is an option for a new instance of Parser.

func WithLogger added in v2.18.0

func WithLogger(logger slog.Logger) Option

WithLogger sets the logger to be used by Parser

type Parser added in v2.18.0

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

Parser parses a Terraform module on disk.

func New added in v2.18.0

func New(workdir string, opts ...Option) (*Parser, tfconfig.Diagnostics)

New returns a new instance of Parser, as well as any diagnostics encountered while parsing the module.

func (*Parser) CoderParameterDefaults added in v2.18.0

func (p *Parser) CoderParameterDefaults(ctx context.Context, varsDefaults map[string]string, names map[string]struct{}) (map[string]string, error)

CoderParameterDefaults returns the default values of all coder_parameter data sources in the parsed module.

func (*Parser) TemplateVariables added in v2.18.0

func (p *Parser) TemplateVariables() ([]*proto.TemplateVariable, error)

TemplateVariables returns all of the Terraform variables in the module as TemplateVariables.

func (*Parser) VariableDefaults added in v2.18.0

func (p *Parser) VariableDefaults(ctx context.Context) (map[string]string, error)

VariableDefaults returns the default values for all variables in the module.

func (*Parser) WorkspaceTagDefaults added in v2.18.0

func (p *Parser) WorkspaceTagDefaults(ctx context.Context) (map[string]string, error)

func (*Parser) WorkspaceTags added in v2.18.0

func (p *Parser) WorkspaceTags(ctx context.Context) (map[string]string, map[string]struct{}, error)

WorkspaceTags looks for all coder_workspace_tags datasource in the module and returns the raw values for the tags. It also returns the set of variables referenced by any expressions in the raw values of tags.

Jump to

Keyboard shortcuts

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