Abs | abs returns the absolute value of the given number. In other words, if the number is zero or positive then it is returned as-is, but if it is negative then it is multiplied by -1 to make it positive before returning it. |
Abspath | abspath takes a string containing a filesystem path and converts it to an absolute path. That is, if the path is not absolute, it will be joined with the current working directory. |
Alltrue | alltrue returns true if all elements in a given collection are true or "true". It also returns true if the collection is empty. |
Anytrue | anytrue returns true if any element in a given collection is true or "true". It also returns false if the collection is empty. |
Base64decode | base64decode takes a string containing a Base64 character sequence and returns the original string. |
Base64encode | base64encode applies Base64 encoding to a string. |
Base64gzip | base64gzip compresses a string with gzip and then encodes the result in Base64 encoding. |
Base64sha256 | base64sha256 computes the SHA256 hash of a given string and encodes it with Base64. This is not equivalent to base64encode(sha256("test")) since sha256() returns hexadecimal representation. |
Base64sha512 | base64sha512 computes the SHA512 hash of a given string and encodes it with Base64. This is not equivalent to base64encode(sha512("test")) since sha512() returns hexadecimal representation. |
Basename | basename takes a string containing a filesystem path and removes all except the last portion from it. |
Can | can evaluates the given expression and returns a boolean value indicating whether the expression produced a result without any errors. |
Ceil | ceil returns the closest whole number that is greater than or equal to the given value, which may be a fraction. |
Chomp | chomp removes newline characters at the end of a string. |
Chunklist | chunklist splits a single list into fixed-size chunks, returning a list of lists. |
Cidrhost | cidrhost calculates a full host IP address for a given host number within a given IP network address prefix. |
Cidrnetmask | cidrnetmask converts an IPv4 address prefix given in CIDR notation into a subnet mask address. |
Cidrsubnet | cidrsubnet calculates a subnet address within given IP network address prefix. |
Cidrsubnets | cidrsubnets calculates a sequence of consecutive IP address ranges within a particular CIDR prefix. |
Coalesce | coalesce takes any number of arguments and returns the first one that isn’t null or an empty string. |
Coalescelist | coalescelist takes any number of list arguments and returns the first one that isn’t empty. |
Compact | compact takes a list of strings and returns a new list with any empty string elements removed. |
Concat | concat takes two or more lists and combines them into a single list. |
Contains | contains determines whether a given list or set contains a given single value as one of its elements. |
Csvdecode | csvdecode decodes a string containing CSV-formatted data and produces a list of maps representing that data. |
Dirname | dirname takes a string containing a filesystem path and removes the last portion from it. |
Distinct | distinct takes a list and returns a new list with any duplicate elements removed. |
Element | element retrieves a single element from a list. |
Endswith | endswith takes two values: a string to check and a suffix string. The function returns true if the first string ends with that exact suffix. |
File | file reads the contents of a file at the given path and returns them as a string. |
Filebase64 | filebase64 reads the contents of a file at the given path and returns them as a base64-encoded string. |
Filebase64sha256 | filebase64sha256 is a variant of base64sha256 that hashes the contents of a given file rather than a literal string. |
Filebase64sha512 | filebase64sha512 is a variant of base64sha512 that hashes the contents of a given file rather than a literal string. |
Fileexists | fileexists determines whether a file exists at a given path. |
Filemd5 | filemd5 is a variant of md5 that hashes the contents of a given file rather than a literal string. |
Fileset | fileset enumerates a set of regular file names given a path and pattern. The path is automatically removed from the resulting set of file names and any result still containing path separators always returns forward slash (/) as the path separator for cross-system compatibility. |
Filesha1 | filesha1 is a variant of sha1 that hashes the contents of a given file rather than a literal string. |
Filesha256 | filesha256 is a variant of sha256 that hashes the contents of a given file rather than a literal string. |
Filesha512 | filesha512 is a variant of sha512 that hashes the contents of a given file rather than a literal string. |
Flatten | flatten takes a list and replaces any elements that are lists with a flattened sequence of the list contents. |
Floor | floor returns the closest whole number that is less than or equal to the given value, which may be a fraction. |
Format | The format function produces a string by formatting a number of other values according to a specification string. It is similar to the printf function in C, and other similar functions in other programming languages. |
Formatdate | formatdate converts a timestamp into a different time format. |
Formatlist | formatlist produces a list of strings by formatting a number of other values according to a specification string. |
Indent | indent adds a given number of spaces to the beginnings of all but the first line in a given multi-line string. |
Index | index finds the element index for a given value in a list. |
Jsondecode | jsondecode interprets a given string as JSON, returning a representation of the result of decoding that string. |
Jsonencode | jsonencode encodes a given value to a string using JSON syntax. |
Keys | keys takes a map and returns a list containing the keys from that map. |
LengthOf | length determines the length of a given list, map, or string. |
Log | log returns the logarithm of a given number in a given base. |
Lower | lower converts all cased letters in the given string to lowercase. |
Matchkeys | matchkeys constructs a new list by taking a subset of elements from one list whose indexes match the corresponding indexes of values in another list. |
Max | max takes one or more numbers and returns the greatest number from the set. |
Md5 | md5 computes the MD5 hash of a given string and encodes it with hexadecimal digits. |
Merge | merge takes an arbitrary number of maps or objects, and returns a single map or object that contains a merged set of elements from all arguments. |
Min | min takes one or more numbers and returns the smallest number from the set. |
Nonsensitive | nonsensitive takes a sensitive value and returns a copy of that value with the sensitive marking removed, thereby exposing the sensitive value. |
One | one takes a list, set, or tuple value with either zero or one elements. If the collection is empty, one returns null. Otherwise, one returns the first element. If there are two or more elements then one will return an error. |
Parseint | parseint parses the given string as a representation of an integer in the specified base and returns the resulting number. The base must be between 2 and 62 inclusive. |
Pathexpand | pathexpand takes a filesystem path that might begin with a ~ segment, and if so it replaces that segment with the current user’s home directory path. |
Plantimestamp | plantimestamp returns a UTC timestamp string in RFC 3339 format, fixed to a constant time representing the time of the plan. |
Pow | pow calculates an exponent, by raising its first argument to the power of the second argument. |
Regex | regex applies a regular expression to a string and returns the matching substrings. |
Regexall | regexall applies a regular expression to a string and returns a list of all matches. |
Replace | replace searches a given string for another given substring, and replaces each occurrence with a given replacement string. |
Reverse | reverse takes a sequence and produces a new sequence of the same length with all of the same elements as the given sequence but in reverse order. |
Rsadecrypt | rsadecrypt decrypts an RSA-encrypted ciphertext, returning the corresponding cleartext. |
Sensitive | sensitive takes any value and returns a copy of it marked so that Terraform will treat it as sensitive, with the same meaning and behavior as for sensitive input variables. |
Setintersection | The setintersection function 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 | The setproduct function finds all of the possible combinations of elements from all of the given sets by computing the Cartesian product. |
Setsubtract | The setsubtract function 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 second set. |
Setunion | The setunion function 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. |
Sha1 | sha1 computes the SHA1 hash of a given string and encodes it with hexadecimal digits. |
Sha256 | sha256 computes the SHA256 hash of a given string and encodes it with hexadecimal digits. |
Sha512 | sha512 computes the SHA512 hash of a given string and encodes it with hexadecimal digits. |
Signum | signum determines the sign of a number, returning a number between -1 and 1 to represent the sign. |
Slice | slice extracts some consecutive elements from within a list. |
Sort | sort takes a list of strings and returns a new list with those strings sorted lexicographically. |
Split | split produces a list by dividing a given string at all occurrences of a given separator. |
Startswith | startswith takes two values: a string to check and a prefix string. The function returns true if the string begins with that exact prefix. |
Strcontains | strcontains takes two values: a string to check and an expected substring. The function returns true if the string has the substring contained within it. |
Strrev | strrev reverses the characters in a string. Note that the characters are treated as Unicode characters (in technical terms, Unicode grapheme cluster boundaries are respected). |
Substr | substr extracts a substring from a given string by offset and (maximum) length. |
Sum | sum takes a list or set of numbers and returns the sum of those numbers. |
Templatefile | templatefile reads the file at the given path and renders its content as a template using a supplied set of template variables. |
Textdecodebase64 | textdecodebase64 function decodes a string that was previously Base64-encoded, and then interprets the result as characters in a specified character encoding. |
Textencodebase64 | textencodebase64 encodes the unicode characters in a given string using a specified character encoding, returning the result base64 encoded because Terraform language strings are always sequences of unicode characters. |
Timeadd | timeadd adds a duration to a timestamp, returning a new timestamp. |
Timecmp | timecmp compares two timestamps and returns a number that represents the ordering of the instants those timestamps represent. |
Timestamp | timestamp returns a UTC timestamp string in RFC 3339 format. |
Title | title converts the first letter of each word in the given string to uppercase. |
Tobool | tobool converts its argument to a boolean value. |
Tolist | tolist converts its argument to a list value. |
Tomap | tomap converts its argument to a map value. |
Tonumber | tonumber converts its argument to a number value. |
Toset | toset converts its argument to a set value. |
Tostring | tostring converts its argument to a string value. |
Transpose | transpose takes a map of lists of strings and swaps the keys and values to produce a new map of lists of strings. |
Trim | trim removes the specified set of characters from the start and end of the given string. |
Trimprefix | trimprefix removes the specified prefix from the start of the given string. If the string does not start with the prefix, the string is returned unchanged. |
Trimspace | trimspace removes any space characters from the start and end of the given string. |
Trimsuffix | trimsuffix removes the specified suffix from the end of the given string. |
Try | try evaluates all of its argument expressions in turn and returns the result of the first one that does not produce any errors. |
Upper | upper converts all cased letters in the given string to uppercase. |
Urlencode | urlencode applies URL encoding to a given string. |
Uuid | uuid generates a unique identifier string. |
Uuidv5 | uuidv5 generates a name-based UUID, as described in RFC 4122 section 4.3, also known as a “version 5” UUID. |
Values | values takes a map and returns a list containing the values of the elements in that map. |
Yamldecode | yamldecode parses a string as a subset of YAML, and produces a representation of its value. |
Yamlencode | yamlencode encodes a given value to a string using YAML 1.2 block syntax. |
Zipmap | zipmap constructs a map from a list of keys and a corresponding list of values. |
Bcrypt | bcrypt computes a hash of the given string using the Blowfish cipher, returning a string in the Modular Crypt Format usually expected in the shadow password file on many Unix systems. |
Conditional | https://developer.hashicorp.com/terraform/language/expressions/conditionals A conditional expression uses the value of a boolean expression to select one of two values. |
Join | join produces a string by concatenating together all elements of a given list of strings with the given delimiter. |
Lookup | lookup retrieves the value of a single element from a map, given its key. If the given key does not exist, the given default value is returned instead. |
LookupNested | returns a property access expression that accesses the property at the given path in the given inputMap. |
Range | range generates a list of numbers using a start value, a limit value, and a step value. |
RawString | Use this function to wrap a string and escape it properly for the use in Terraform This is only needed in certain scenarios (e.g., if you have unescaped double quotes in the string). |