hcl

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnvFunc = function.New(&function.Spec{
	Params: []function.Parameter{
		{
			Name:             "str",
			Type:             cty.String,
			AllowDynamicType: true,
		},
	},
	Type: function.StaticReturnType(cty.String),
	Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) {
		in := args[0].AsString()
		out := os.Getenv(in)
		return cty.StringVal(out), nil
	},
})

EnvFunc gets an environment variable, if env variable is not found it will return blank string

Functions

func EmptyBody

func EmptyBody() hcl2.Body

EmptyBody returns a body with no content. This body can be used as a placeholder when a body is required but no body content is available.

func MergeBodiesWithOverides

func MergeBodiesWithOverides(bodies []hcl2.Body) hcl2.Body

MergeBodiesWithOverides merges several bodies into one. This is similar implementation as the one in official library, but it overwrites attributes that are already defined.

func NewContext

func NewContext() *hcl.EvalContext

NewContext creates a new evaluation context that supports all terraform functions and custom functions defined in tau

Types

This section is empty.

Jump to

Keyboard shortcuts

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