funcs

package
v0.25.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package funcs defines extra HCL functions.

Index

Constants

This section is empty.

Variables

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

EnvFunc returns the value of an environment variable by name. If the environment variable doesn't exist, an empty string is returned.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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