Documentation ¶
Index ¶
Constants ¶
View Source
const (
// OutputRegex for printing yaml/json output
OutputRegex = `(?m)^[ ]*([^\r\n:]+?)\s*:`
)
config environment variable
Variables ¶
View Source
var ( // gentime function maps GenTimeFunctions = template.FuncMap{ "add": func(a int, b int) int { log.Debug("Calling Template Function [add] with arguments: %s + %s", a, b) return a + b }, "strip": func(s string, rmv string) string { log.Debug("Calling Template Function [strip] with arguments: (%s, %s) ", s, rmv) return strings.Replace(s, rmv, "", -1) }, "cat": func(path string) string { log.Debug("Calling Template Function [cat] with arguments: %s", path) b, err := ioutil.ReadFile(path) utils.HandleError(err) return string(b) }, "literal": literal, "suffix": suffix, "prefix": prefix, "contains": contains, "loop": loop, "GET": httpGet, "s3_read": s3Read, "invoke": lambdaInvoke, "kms_encrypt": kmsEncrypt, "kms_decrypt": kmsDecrypt, "mod": func(a int, b int) int { log.Debug("Calling Template Function [mod] with arguments: %s % %s", a, b) return a % b }, "seq": func(from, to int) []int { log.Debug("Calling Template Function [seq] with arguments: %s % %s", from, to) seq := make([]int, to-from+1) for i := range seq { seq[i] = from + i } return seq }, } // deploytime function maps DeployTimeFunctions = template.FuncMap{ "stack_output": func(target string) string { log.Debug("Deploy-Time function resolving: %s", target) req := strings.Split(target, "::") s, ok := stacks.Get(req[0]) if !ok { utils.HandleError(fmt.Errorf("stack_output errror: stack [%s] not found", req[0])) } utils.HandleError(s.Outputs()) for _, i := range s.Output.Stacks { for _, o := range i.Outputs { if *o.OutputKey == req[1] { return *o.OutputValue } } } utils.HandleError(fmt.Errorf("Stack Output Not found - Stack:%s | Output:%s", req[0], req[1])) return "" }, "stack_output_ext": func(target string) string { log.Debug("Deploy-Time function resolving: %s", target) req := strings.Split(target, "::") sess, err := GetSession() utils.HandleError(err) s := stks.Stack{ Stackname: req[0], Session: sess, } err = s.Outputs() utils.HandleError(err) for _, i := range s.Output.Stacks { for _, o := range i.Outputs { if *o.OutputKey == req[1] { return *o.OutputValue } } } utils.HandleError(fmt.Errorf("Stack Output Not found - Stack:%s | Output:%s", req[0], req[1])) return "" }, "suffix": suffix, "prefix": prefix, "contains": contains, "loop": loop, "literal": literal, "GET": httpGet, "s3_read": s3Read, "invoke": lambdaInvoke, "kms_encrypt": kmsEncrypt, "kms_decrypt": kmsDecrypt, } )
Common Functions - Both Deploy/Gen
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.