»Full Function Reference

This page contains an automatically generated list of all the available functions within the Waypoint configuration file. To navigate this page more easily, we recommend using your browser's find feature (Cmd-F or Ctrl-F) along with the "Jump to Section" dropdown above.

»abs

abs(num) number

return the absolute value of the given number

»abspath

abspath(path) string

convert the path into an absolute path

»base64decode

base64decode(str) string

decode the given string in base64 encoding back to binary

»base64encode

base64encode(str) string

encode the given string to base64 encoding

»base64gzip

base64gzip(str) string

gzip the given string and encode the compressed body as base64

»basename

basename(path) string

return the last component of the string interpreted as a filesystem path

»ceil

ceil(num) number

round the given number to the next integer

»chomp

chomp(str) string

remove white space from the start and end of the given string

»chunklist

chunklist(list, size) list of list of dynamic

a single list into fixed-size chunks, returning a list of lists

»coalescelist

coalescelist(vals) dynamic

take any number of list arguments and returns the first one that isn't empty

»compact

compact(list) list of string

remove empty strings from a list

»concat

concat(seqs) dynamic

combine 2 or more lists into a single list

»contains

contains(list, value) dynamic

determines whether a given list or set contains a given single value as one of its elements

»csvdecode

csvdecode(str) dynamic

decodes a string containing CSV-formatted data and produces a list of maps representing that data

»dirname

dirname(path) string

return all except the last component of the string interpreted as a filesystem path

»distinct

distinct(list) list of dynamic

removes any duplicate elements from a list

»element

element(list, index) dynamic

return the value at given numeric index in the list

»file

file(path) string

return the data in the file located at the given path

»filebase64

filebase64(path) string

return the data in the file located at the given path after base64 decoding it

»fileexists

fileexists(path) bool

indicate if a file exists at the given path

»fileset

fileset(path, pattern) set of string

gather a list of paths that match the given pattern under the given directory

»flatten

flatten(list) dynamic

remove any embedded lists by moving the contents to the outer list

»floor

floor(num) number

round the given number to the lowest next integer

»format

format(format, args) dynamic

format a string according to the given parameters

»formatdate

formatdate(format, time) string

format the current date as a string according to the given parameters

»formatlist

formatlist(format, args) dynamic

apply the format() function across all values in the given lists

»gitrefhash

gitrefhash() string

return the full git hash for the HEAD ref

»gitrefpretty

gitrefpretty() string

return a humanized version of the git hash, taking into account tags and changes

»gitreftag

gitreftag() string

return the tag name that points to the HEAD ref

»gitremoteurl

gitremoteurl(name) string

return the remote url of the git repo

»indent

indent(spaces, str) string

indent each line of the given string

»join

join(separator, lists) string

create a string by joining each list element with the given separator

»jsondecode

jsondecode(str) dynamic

decode the given string as json into HCL values

»jsonencode

jsonencode(val) string

encode the given HCL value as json

»jsonnetdir

jsonnetdir(dir, options) dynamic

convert a directory of Jsonnet files into JSON, returning a path

»jsonnetfile

jsonnetfile(path, options) dynamic

convert a Jsonnet file into JSON, returning a file path

»keys

keys(inputMap) dynamic

return a list of the keys present in the given map

»log

log(num, base) number

returns the logarithm of a given number in a given base

»lower

lower(str) string

convert the given string to lower case according the unicode rules

»max

max(numbers) number

return the largest number present in the list

»merge

merge(maps) dynamic

combine a set of map or objects together as one map

»min

min(numbers) number

return the smallest number present in the list

»parseint

parseint(number, base) dynamic

parse the string as a number of the given base and return an HCL number value

»pathexpand

pathexpand(path) string

expand any tildes in the given path

»pow

pow(num, power) number

raise the given number to the given power

»range

range(params) list of number

generate a list of numbers

»regex

regex(pattern, string) dynamic

match the given string against the given regular expression pattern, returning captures if defined

»regexall

regexall(pattern, string) list of dynamic

same as regex but look for all matches of the given pattern rather than just the first

»reverse

reverse(list) dynamic

reverse the order of the elements in the list

»setintersection

setintersection(first_set, other_sets) set of dynamic

takes multiple sets and produces a single set containing only the elements that all of the given sets have in common. In other words, it computes the intersection of the sets

»setproduct

setproduct(sets) dynamic

finds all of the possible combinations of elements from all of the given sets by computing the Cartesian product

»setsubtract

setsubtract(a, b) set of dynamic

returns a new set containing the elements from the first set that are not present in the second set. In other words, it computes the relative complement of the first set in the second set

»setunion

setunion(first_set, other_sets) set of dynamic

takes multiple sets and produces a single set containing the elements from all of the given sets. In other words, it computes the union of the sets

»signum

signum(num) number

indicates the sign of the given number by -1, 0, or 1

»slice

slice(list, start_index, end_index) dynamic

return a subset of the given list

»sort

sort(list) list of string

reorder the given elements according to their sorting order

»split

split(separator, str) list of string

break the given string up into substrings

»strrev

strrev(str) string

reverse the characters in the given string

»substr

substr(str, offset, length) string

return a subset of the given string

»timeadd

timeadd(timestamp, duration) string

add a quantum of time to the given timestamp to calculate a new timestamp

»timestamp

timestamp() string

»title

title(str) string

upper case each character on each word in the given string

»trim

trim(str, cutset) string

remove characters present in the cutset from the given string from the head and tail of the string

»trimprefix

trimprefix(str, prefix) string

remove the given prefix from the string

»trimspace

trimspace(str) string

remove space charaters from the head and tail of the string

»trimsuffix

trimsuffix(str, suffix) string

remove the given suffix from the string

»upper

upper(str) string

convert each character to upper case according to the unicode rules

»urlencode

urlencode(str) string

encode the given string according to the url encoding rules

»values

values(values) dynamic

return the list of values in the given map or object

»yamldecode

yamldecode(src) dynamic

decode the string as YAML and return the equiv HCL values

»yamlencode

yamlencode(value) string

convert the given HCL values to YAML

»zipmap

zipmap(keys, values) dynamic

construct a map from a list of keys and a corresponding list of values