Skip to main content

Initializers

import io.cdktn.cdktn.Fn;

new Fn();
NameTypeDescription

Static Functions

NameDescription
absabs 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.
abspathabspath 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.
alltruealltrue returns true if all elements in a given collection are true or "true". It also returns true if the collection is empty.
anytrueanytrue returns true if any element in a given collection is true or "true". It also returns false if the collection is empty.
base64decodebase64decode takes a string containing a Base64 character sequence and returns the original string.
base64encodebase64encode applies Base64 encoding to a string.
base64gzipbase64gzip compresses a string with gzip and then encodes the result in Base64 encoding.
base64sha256base64sha256 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.
base64sha512base64sha512 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.
basenamebasename takes a string containing a filesystem path and removes all except the last portion from it.
cancan evaluates the given expression and returns a boolean value indicating whether the expression produced a result without any errors.
ceilceil returns the closest whole number that is greater than or equal to the given value, which may be a fraction.
chompchomp removes newline characters at the end of a string.
chunklistchunklist splits a single list into fixed-size chunks, returning a list of lists.
cidrhostcidrhost calculates a full host IP address for a given host number within a given IP network address prefix.
cidrnetmaskcidrnetmask converts an IPv4 address prefix given in CIDR notation into a subnet mask address.
cidrsubnetcidrsubnet calculates a subnet address within given IP network address prefix.
cidrsubnetscidrsubnets calculates a sequence of consecutive IP address ranges within a particular CIDR prefix.
coalescecoalesce takes any number of arguments and returns the first one that isn’t null or an empty string.
coalescelistcoalescelist takes any number of list arguments and returns the first one that isn’t empty.
compactcompact takes a list of strings and returns a new list with any empty string elements removed.
concatconcat takes two or more lists and combines them into a single list.
containscontains determines whether a given list or set contains a given single value as one of its elements.
csvdecodecsvdecode decodes a string containing CSV-formatted data and produces a list of maps representing that data.
dirnamedirname takes a string containing a filesystem path and removes the last portion from it.
distinctdistinct takes a list and returns a new list with any duplicate elements removed.
elementelement retrieves a single element from a list.
endswithendswith takes two values: a string to check and a suffix string. The function returns true if the first string ends with that exact suffix.
filefile reads the contents of a file at the given path and returns them as a string.
filebase64filebase64 reads the contents of a file at the given path and returns them as a base64-encoded string.
filebase64sha256filebase64sha256 is a variant of base64sha256 that hashes the contents of a given file rather than a literal string.
filebase64sha512filebase64sha512 is a variant of base64sha512 that hashes the contents of a given file rather than a literal string.
fileexistsfileexists determines whether a file exists at a given path.
filemd5filemd5 is a variant of md5 that hashes the contents of a given file rather than a literal string.
filesetfileset 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.
filesha1filesha1 is a variant of sha1 that hashes the contents of a given file rather than a literal string.
filesha256filesha256 is a variant of sha256 that hashes the contents of a given file rather than a literal string.
filesha512filesha512 is a variant of sha512 that hashes the contents of a given file rather than a literal string.
flattenflatten takes a list and replaces any elements that are lists with a flattened sequence of the list contents.
floorfloor returns the closest whole number that is less than or equal to the given value, which may be a fraction.
formatThe 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.
formatdateformatdate converts a timestamp into a different time format.
formatlistformatlist produces a list of strings by formatting a number of other values according to a specification string.
indentindent adds a given number of spaces to the beginnings of all but the first line in a given multi-line string.
indexindex finds the element index for a given value in a list.
jsondecodejsondecode interprets a given string as JSON, returning a representation of the result of decoding that string.
jsonencodejsonencode encodes a given value to a string using JSON syntax.
keyskeys takes a map and returns a list containing the keys from that map.
lengthOflength determines the length of a given list, map, or string.
loglog returns the logarithm of a given number in a given base.
lowerlower converts all cased letters in the given string to lowercase.
matchkeysmatchkeys constructs a new list by taking a subset of elements from one list whose indexes match the corresponding indexes of values in another list.
maxmax takes one or more numbers and returns the greatest number from the set.
md5md5 computes the MD5 hash of a given string and encodes it with hexadecimal digits.
mergemerge 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.
minmin takes one or more numbers and returns the smallest number from the set.
nonsensitivenonsensitive takes a sensitive value and returns a copy of that value with the sensitive marking removed, thereby exposing the sensitive value.
oneone 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.
parseintparseint 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.
pathexpandpathexpand 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.
plantimestampplantimestamp returns a UTC timestamp string in RFC 3339 format, fixed to a constant time representing the time of the plan.
powpow calculates an exponent, by raising its first argument to the power of the second argument.
regexregex applies a regular expression to a string and returns the matching substrings.
regexallregexall applies a regular expression to a string and returns a list of all matches.
replacereplace searches a given string for another given substring, and replaces each occurrence with a given replacement string.
reversereverse 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.
rsadecryptrsadecrypt decrypts an RSA-encrypted ciphertext, returning the corresponding cleartext.
sensitivesensitive 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.
setintersectionThe 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.
setproductThe setproduct function finds all of the possible combinations of elements from all of the given sets by computing the Cartesian product.
setsubtractThe 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.
setunionThe 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.
sha1sha1 computes the SHA1 hash of a given string and encodes it with hexadecimal digits.
sha256sha256 computes the SHA256 hash of a given string and encodes it with hexadecimal digits.
sha512sha512 computes the SHA512 hash of a given string and encodes it with hexadecimal digits.
signumsignum determines the sign of a number, returning a number between -1 and 1 to represent the sign.
sliceslice extracts some consecutive elements from within a list.
sortsort takes a list of strings and returns a new list with those strings sorted lexicographically.
splitsplit produces a list by dividing a given string at all occurrences of a given separator.
startswithstartswith takes two values: a string to check and a prefix string. The function returns true if the string begins with that exact prefix.
strcontainsstrcontains takes two values: a string to check and an expected substring. The function returns true if the string has the substring contained within it.
strrevstrrev reverses the characters in a string. Note that the characters are treated as Unicode characters (in technical terms, Unicode grapheme cluster boundaries are respected).
substrsubstr extracts a substring from a given string by offset and (maximum) length.
sumsum takes a list or set of numbers and returns the sum of those numbers.
templatefiletemplatefile reads the file at the given path and renders its content as a template using a supplied set of template variables.
textdecodebase64textdecodebase64 function decodes a string that was previously Base64-encoded, and then interprets the result as characters in a specified character encoding.
textencodebase64textencodebase64 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.
timeaddtimeadd adds a duration to a timestamp, returning a new timestamp.
timecmptimecmp compares two timestamps and returns a number that represents the ordering of the instants those timestamps represent.
timestamptimestamp returns a UTC timestamp string in RFC 3339 format.
titletitle converts the first letter of each word in the given string to uppercase.
tobooltobool converts its argument to a boolean value.
tolisttolist converts its argument to a list value.
tomaptomap converts its argument to a map value.
tonumbertonumber converts its argument to a number value.
tosettoset converts its argument to a set value.
tostringtostring converts its argument to a string value.
transposetranspose takes a map of lists of strings and swaps the keys and values to produce a new map of lists of strings.
trimtrim removes the specified set of characters from the start and end of the given string.
trimprefixtrimprefix 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.
trimspacetrimspace removes any space characters from the start and end of the given string.
trimsuffixtrimsuffix removes the specified suffix from the end of the given string.
trytry evaluates all of its argument expressions in turn and returns the result of the first one that does not produce any errors.
upperupper converts all cased letters in the given string to uppercase.
urlencodeurlencode applies URL encoding to a given string.
uuiduuid generates a unique identifier string.
uuidv5uuidv5 generates a name-based UUID, as described in RFC 4122 section 4.3, also known as a “version 5” UUID.
valuesvalues takes a map and returns a list containing the values of the elements in that map.
yamldecodeyamldecode parses a string as a subset of YAML, and produces a representation of its value.
yamlencodeyamlencode encodes a given value to a string using YAML 1.2 block syntax.
zipmapzipmap constructs a map from a list of keys and a corresponding list of values.
bcryptbcrypt 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.
conditionalhttps://developer.hashicorp.com/terraform/language/expressions/conditionals A conditional expression uses the value of a boolean expression to select one of two values.
joinjoin produces a string by concatenating together all elements of a given list of strings with the given delimiter.
lookuplookup 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.
lookupNestedreturns a property access expression that accesses the property at the given path in the given inputMap.
rangerange generates a list of numbers using a start value, a limit value, and a step value.
rawStringUse 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).

abs

import io.cdktn.cdktn.Fn;

Fn.abs(java.lang.Number num)
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.

numRequired

  • Type: java.lang.Number

abspath

import io.cdktn.cdktn.Fn;

Fn.abspath(java.lang.String path)
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.

pathRequired

  • Type: java.lang.String

alltrue

import io.cdktn.cdktn.Fn;

Fn.alltrue(java.util.List<java.lang.Object> list)
alltrue returns true if all elements in a given collection are true or "true". It also returns true if the collection is empty.

listRequired

  • Type: java.util.List< java.lang.Object >

anytrue

import io.cdktn.cdktn.Fn;

Fn.anytrue(java.util.List<java.lang.Object> list)
anytrue returns true if any element in a given collection is true or "true". It also returns false if the collection is empty.

listRequired

  • Type: java.util.List< java.lang.Object >

base64decode

import io.cdktn.cdktn.Fn;

Fn.base64decode(java.lang.String str)
base64decode takes a string containing a Base64 character sequence and returns the original string.

strRequired

  • Type: java.lang.String

base64encode

import io.cdktn.cdktn.Fn;

Fn.base64encode(java.lang.String str)
base64encode applies Base64 encoding to a string.

strRequired

  • Type: java.lang.String

base64gzip

import io.cdktn.cdktn.Fn;

Fn.base64gzip(java.lang.String str)
base64gzip compresses a string with gzip and then encodes the result in Base64 encoding.

strRequired

  • Type: java.lang.String

base64sha256

import io.cdktn.cdktn.Fn;

Fn.base64sha256(java.lang.String str)
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.

strRequired

  • Type: java.lang.String

base64sha512

import io.cdktn.cdktn.Fn;

Fn.base64sha512(java.lang.String str)
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.

strRequired

  • Type: java.lang.String

basename

import io.cdktn.cdktn.Fn;

Fn.basename(java.lang.String path)
basename takes a string containing a filesystem path and removes all except the last portion from it.

pathRequired

  • Type: java.lang.String

can

import io.cdktn.cdktn.Fn;

Fn.can(java.lang.Object expression)
can evaluates the given expression and returns a boolean value indicating whether the expression produced a result without any errors.

expressionRequired

  • Type: java.lang.Object

ceil

import io.cdktn.cdktn.Fn;

Fn.ceil(java.lang.Number num)
ceil returns the closest whole number that is greater than or equal to the given value, which may be a fraction.

numRequired

  • Type: java.lang.Number

chomp

import io.cdktn.cdktn.Fn;

Fn.chomp(java.lang.String str)
chomp removes newline characters at the end of a string.

strRequired

  • Type: java.lang.String

chunklist

import io.cdktn.cdktn.Fn;

Fn.chunklist(java.util.List<java.lang.Object> list, java.lang.Number size)
chunklist splits a single list into fixed-size chunks, returning a list of lists.

listRequired

  • Type: java.util.List< java.lang.Object >

sizeRequired

  • Type: java.lang.Number

cidrhost

import io.cdktn.cdktn.Fn;

Fn.cidrhost(java.lang.String prefix, java.lang.Number hostnum)
cidrhost calculates a full host IP address for a given host number within a given IP network address prefix.

prefixRequired

  • Type: java.lang.String

hostnumRequired

  • Type: java.lang.Number

cidrnetmask

import io.cdktn.cdktn.Fn;

Fn.cidrnetmask(java.lang.String prefix)
cidrnetmask converts an IPv4 address prefix given in CIDR notation into a subnet mask address.

prefixRequired

  • Type: java.lang.String

cidrsubnet

import io.cdktn.cdktn.Fn;

Fn.cidrsubnet(java.lang.String prefix, java.lang.Number newbits, java.lang.Number netnum)
cidrsubnet calculates a subnet address within given IP network address prefix.

prefixRequired

  • Type: java.lang.String

newbitsRequired

  • Type: java.lang.Number

netnumRequired

  • Type: java.lang.Number

cidrsubnets

import io.cdktn.cdktn.Fn;

Fn.cidrsubnets(java.lang.String prefix, java.util.List<java.lang.Number> newbits)
cidrsubnets calculates a sequence of consecutive IP address ranges within a particular CIDR prefix.

prefixRequired

  • Type: java.lang.String

newbitsRequired

  • Type: java.util.List< java.lang.Number >

coalesce

import io.cdktn.cdktn.Fn;

Fn.coalesce(java.util.List<java.lang.Object> vals)
coalesce takes any number of arguments and returns the first one that isn’t null or an empty string.

valsRequired

  • Type: java.util.List< java.lang.Object >

coalescelist

import io.cdktn.cdktn.Fn;

Fn.coalescelist(java.util.List<java.lang.Object> vals)
coalescelist takes any number of list arguments and returns the first one that isn’t empty.

valsRequired

  • Type: java.util.List< java.lang.Object >

compact

import io.cdktn.cdktn.Fn;

Fn.compact(java.util.List<java.lang.String> list)
compact takes a list of strings and returns a new list with any empty string elements removed.

listRequired

  • Type: java.util.List< java.lang.String >

concat

import io.cdktn.cdktn.Fn;

Fn.concat(java.util.List<java.lang.Object> seqs)
concat takes two or more lists and combines them into a single list.

seqsRequired

  • Type: java.util.List< java.lang.Object >

contains

import io.cdktn.cdktn.Fn;

Fn.contains(java.lang.Object list, java.lang.Object value)
contains determines whether a given list or set contains a given single value as one of its elements.

listRequired

  • Type: java.lang.Object

valueRequired

  • Type: java.lang.Object

csvdecode

import io.cdktn.cdktn.Fn;

Fn.csvdecode(java.lang.String str)
csvdecode decodes a string containing CSV-formatted data and produces a list of maps representing that data.

strRequired

  • Type: java.lang.String

dirname

import io.cdktn.cdktn.Fn;

Fn.dirname(java.lang.String path)
dirname takes a string containing a filesystem path and removes the last portion from it.

pathRequired

  • Type: java.lang.String

distinct

import io.cdktn.cdktn.Fn;

Fn.distinct(java.util.List<java.lang.Object> list)
distinct takes a list and returns a new list with any duplicate elements removed.

listRequired

  • Type: java.util.List< java.lang.Object >

element

import io.cdktn.cdktn.Fn;

Fn.element(java.lang.Object list, java.lang.Number index)
element retrieves a single element from a list.

listRequired

  • Type: java.lang.Object

indexRequired

  • Type: java.lang.Number

endswith

import io.cdktn.cdktn.Fn;

Fn.endswith(java.lang.String str, java.lang.String suffix)
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.

strRequired

  • Type: java.lang.String

suffixRequired

  • Type: java.lang.String

file

import io.cdktn.cdktn.Fn;

Fn.file(java.lang.String path)
file reads the contents of a file at the given path and returns them as a string.

pathRequired

  • Type: java.lang.String

filebase64

import io.cdktn.cdktn.Fn;

Fn.filebase64(java.lang.String path)
filebase64 reads the contents of a file at the given path and returns them as a base64-encoded string.

pathRequired

  • Type: java.lang.String

filebase64sha256

import io.cdktn.cdktn.Fn;

Fn.filebase64sha256(java.lang.String path)
filebase64sha256 is a variant of base64sha256 that hashes the contents of a given file rather than a literal string.

pathRequired

  • Type: java.lang.String

filebase64sha512

import io.cdktn.cdktn.Fn;

Fn.filebase64sha512(java.lang.String path)
filebase64sha512 is a variant of base64sha512 that hashes the contents of a given file rather than a literal string.

pathRequired

  • Type: java.lang.String

fileexists

import io.cdktn.cdktn.Fn;

Fn.fileexists(java.lang.String path)
fileexists determines whether a file exists at a given path.

pathRequired

  • Type: java.lang.String

filemd5

import io.cdktn.cdktn.Fn;

Fn.filemd5(java.lang.String path)
filemd5 is a variant of md5 that hashes the contents of a given file rather than a literal string.

pathRequired

  • Type: java.lang.String

fileset

import io.cdktn.cdktn.Fn;

Fn.fileset(java.lang.String path, java.lang.String pattern)
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.

pathRequired

  • Type: java.lang.String

patternRequired

  • Type: java.lang.String

filesha1

import io.cdktn.cdktn.Fn;

Fn.filesha1(java.lang.String path)
filesha1 is a variant of sha1 that hashes the contents of a given file rather than a literal string.

pathRequired

  • Type: java.lang.String

filesha256

import io.cdktn.cdktn.Fn;

Fn.filesha256(java.lang.String path)
filesha256 is a variant of sha256 that hashes the contents of a given file rather than a literal string.

pathRequired

  • Type: java.lang.String

filesha512

import io.cdktn.cdktn.Fn;

Fn.filesha512(java.lang.String path)
filesha512 is a variant of sha512 that hashes the contents of a given file rather than a literal string.

pathRequired

  • Type: java.lang.String

flatten

import io.cdktn.cdktn.Fn;

Fn.flatten(java.lang.Object list)
flatten takes a list and replaces any elements that are lists with a flattened sequence of the list contents.

listRequired

  • Type: java.lang.Object

floor

import io.cdktn.cdktn.Fn;

Fn.floor(java.lang.Number num)
floor returns the closest whole number that is less than or equal to the given value, which may be a fraction.

numRequired

  • Type: java.lang.Number

format

import io.cdktn.cdktn.Fn;

Fn.format(java.lang.String format, java.util.List<java.lang.Object> args)
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.

formatRequired

  • Type: java.lang.String

argsRequired

  • Type: java.util.List< java.lang.Object >

formatdate

import io.cdktn.cdktn.Fn;

Fn.formatdate(java.lang.String format, java.lang.String time)
formatdate converts a timestamp into a different time format.

formatRequired

  • Type: java.lang.String

timeRequired

  • Type: java.lang.String

formatlist

import io.cdktn.cdktn.Fn;

Fn.formatlist(java.lang.String format, java.util.List<java.lang.Object> args)
formatlist produces a list of strings by formatting a number of other values according to a specification string.

formatRequired

  • Type: java.lang.String

argsRequired

  • Type: java.util.List< java.lang.Object >

indent

import io.cdktn.cdktn.Fn;

Fn.indent(java.lang.Number spaces, java.lang.String str)
indent adds a given number of spaces to the beginnings of all but the first line in a given multi-line string.

spacesRequired

  • Type: java.lang.Number

strRequired

  • Type: java.lang.String

index

import io.cdktn.cdktn.Fn;

Fn.index(java.lang.Object list, java.lang.Object value)
index finds the element index for a given value in a list.

listRequired

  • Type: java.lang.Object

valueRequired

  • Type: java.lang.Object

jsondecode

import io.cdktn.cdktn.Fn;

Fn.jsondecode(java.lang.String str)
jsondecode interprets a given string as JSON, returning a representation of the result of decoding that string.

strRequired

  • Type: java.lang.String

jsonencode

import io.cdktn.cdktn.Fn;

Fn.jsonencode(java.lang.Object val)
jsonencode encodes a given value to a string using JSON syntax.

valRequired

  • Type: java.lang.Object

keys

import io.cdktn.cdktn.Fn;

Fn.keys(java.lang.Object inputMap)
keys takes a map and returns a list containing the keys from that map.

inputMapRequired

  • Type: java.lang.Object

lengthOf

import io.cdktn.cdktn.Fn;

Fn.lengthOf(java.lang.Object value)
length determines the length of a given list, map, or string.

valueRequired

  • Type: java.lang.Object

log

import io.cdktn.cdktn.Fn;

Fn.log(java.lang.Number num, java.lang.Number base)
log returns the logarithm of a given number in a given base.

numRequired

  • Type: java.lang.Number

baseRequired

  • Type: java.lang.Number

lower

import io.cdktn.cdktn.Fn;

Fn.lower(java.lang.String str)
lower converts all cased letters in the given string to lowercase.

strRequired

  • Type: java.lang.String

matchkeys

import io.cdktn.cdktn.Fn;

Fn.matchkeys(java.util.List<java.lang.Object> values, java.util.List<java.lang.Object> keys, java.util.List<java.lang.Object> searchset)
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.

valuesRequired

  • Type: java.util.List< java.lang.Object >

keysRequired

  • Type: java.util.List< java.lang.Object >

searchsetRequired

  • Type: java.util.List< java.lang.Object >

max

import io.cdktn.cdktn.Fn;

Fn.max(java.util.List<java.lang.Number> numbers)
max takes one or more numbers and returns the greatest number from the set.

numbersRequired

  • Type: java.util.List< java.lang.Number >

md5

import io.cdktn.cdktn.Fn;

Fn.md5(java.lang.String str)
md5 computes the MD5 hash of a given string and encodes it with hexadecimal digits.

strRequired

  • Type: java.lang.String

merge

import io.cdktn.cdktn.Fn;

Fn.merge(java.util.List<java.lang.Object> maps)
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.

mapsRequired

  • Type: java.util.List< java.lang.Object >

min

import io.cdktn.cdktn.Fn;

Fn.min(java.util.List<java.lang.Number> numbers)
min takes one or more numbers and returns the smallest number from the set.

numbersRequired

  • Type: java.util.List< java.lang.Number >

nonsensitive

import io.cdktn.cdktn.Fn;

Fn.nonsensitive(java.lang.Object value)
nonsensitive takes a sensitive value and returns a copy of that value with the sensitive marking removed, thereby exposing the sensitive value.

valueRequired

  • Type: java.lang.Object

one

import io.cdktn.cdktn.Fn;

Fn.one(java.lang.Object list)
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.

listRequired

  • Type: java.lang.Object

parseint

import io.cdktn.cdktn.Fn;

Fn.parseint(java.lang.Object number, java.lang.Number base)
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.

numberRequired

  • Type: java.lang.Object

baseRequired

  • Type: java.lang.Number

pathexpand

import io.cdktn.cdktn.Fn;

Fn.pathexpand(java.lang.String path)
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.

pathRequired

  • Type: java.lang.String

plantimestamp

import io.cdktn.cdktn.Fn;

Fn.plantimestamp()
plantimestamp returns a UTC timestamp string in RFC 3339 format, fixed to a constant time representing the time of the plan.

pow

import io.cdktn.cdktn.Fn;

Fn.pow(java.lang.Number num, java.lang.Number power)
pow calculates an exponent, by raising its first argument to the power of the second argument.

numRequired

  • Type: java.lang.Number

powerRequired

  • Type: java.lang.Number

regex

import io.cdktn.cdktn.Fn;

Fn.regex(java.lang.String pattern, java.lang.String str)
regex applies a regular expression to a string and returns the matching substrings.

patternRequired

  • Type: java.lang.String

strRequired

  • Type: java.lang.String

regexall

import io.cdktn.cdktn.Fn;

Fn.regexall(java.lang.String pattern, java.lang.String str)
regexall applies a regular expression to a string and returns a list of all matches.

patternRequired

  • Type: java.lang.String

strRequired

  • Type: java.lang.String

replace

import io.cdktn.cdktn.Fn;

Fn.replace(java.lang.String str, java.lang.String substr, java.lang.String replace)
replace searches a given string for another given substring, and replaces each occurrence with a given replacement string.

strRequired

  • Type: java.lang.String

substrRequired

  • Type: java.lang.String

replaceRequired

  • Type: java.lang.String

reverse

import io.cdktn.cdktn.Fn;

Fn.reverse(java.lang.Object list)
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.

listRequired

  • Type: java.lang.Object

rsadecrypt

import io.cdktn.cdktn.Fn;

Fn.rsadecrypt(java.lang.String ciphertext, java.lang.String privatekey)
rsadecrypt decrypts an RSA-encrypted ciphertext, returning the corresponding cleartext.

ciphertextRequired

  • Type: java.lang.String

privatekeyRequired

  • Type: java.lang.String

sensitive

import io.cdktn.cdktn.Fn;

Fn.sensitive(java.lang.Object value)
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.

valueRequired

  • Type: java.lang.Object

setintersection

import io.cdktn.cdktn.Fn;

Fn.setintersection(java.util.List<java.lang.Object> first_set, java.util.List<java.util.List<java.lang.Object>> other_sets)
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.

first_setRequired

  • Type: java.util.List< java.lang.Object >

other_setsRequired

  • Type: java.util.List< java.util.List<java.lang.Object >>

setproduct

import io.cdktn.cdktn.Fn;

Fn.setproduct(java.util.List<java.lang.Object> sets)
The setproduct function finds all of the possible combinations of elements from all of the given sets by computing the Cartesian product.

setsRequired

  • Type: java.util.List< java.lang.Object >

setsubtract

import io.cdktn.cdktn.Fn;

Fn.setsubtract(java.util.List<java.lang.Object> a, java.util.List<java.lang.Object> b)
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.

aRequired

  • Type: java.util.List< java.lang.Object >

bRequired

  • Type: java.util.List< java.lang.Object >

setunion

import io.cdktn.cdktn.Fn;

Fn.setunion(java.util.List<java.lang.Object> first_set, java.util.List<java.util.List<java.lang.Object>> other_sets)
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.

first_setRequired

  • Type: java.util.List< java.lang.Object >

other_setsRequired

  • Type: java.util.List< java.util.List<java.lang.Object >>

sha1

import io.cdktn.cdktn.Fn;

Fn.sha1(java.lang.String str)
sha1 computes the SHA1 hash of a given string and encodes it with hexadecimal digits.

strRequired

  • Type: java.lang.String

sha256

import io.cdktn.cdktn.Fn;

Fn.sha256(java.lang.String str)
sha256 computes the SHA256 hash of a given string and encodes it with hexadecimal digits.

strRequired

  • Type: java.lang.String

sha512

import io.cdktn.cdktn.Fn;

Fn.sha512(java.lang.String str)
sha512 computes the SHA512 hash of a given string and encodes it with hexadecimal digits.

strRequired

  • Type: java.lang.String

signum

import io.cdktn.cdktn.Fn;

Fn.signum(java.lang.Number num)
signum determines the sign of a number, returning a number between -1 and 1 to represent the sign.

numRequired

  • Type: java.lang.Number

slice

import io.cdktn.cdktn.Fn;

Fn.slice(java.lang.Object list, java.lang.Number start_index, java.lang.Number end_index)
slice extracts some consecutive elements from within a list.

listRequired

  • Type: java.lang.Object

start_indexRequired

  • Type: java.lang.Number

end_indexRequired

  • Type: java.lang.Number

sort

import io.cdktn.cdktn.Fn;

Fn.sort(java.util.List<java.lang.String> list)
sort takes a list of strings and returns a new list with those strings sorted lexicographically.

listRequired

  • Type: java.util.List< java.lang.String >

split

import io.cdktn.cdktn.Fn;

Fn.split(java.lang.String separator, java.lang.String str)
split produces a list by dividing a given string at all occurrences of a given separator.

separatorRequired

  • Type: java.lang.String

strRequired

  • Type: java.lang.String

startswith

import io.cdktn.cdktn.Fn;

Fn.startswith(java.lang.String str, java.lang.String prefix)
startswith takes two values: a string to check and a prefix string. The function returns true if the string begins with that exact prefix.

strRequired

  • Type: java.lang.String

prefixRequired

  • Type: java.lang.String

strcontains

import io.cdktn.cdktn.Fn;

Fn.strcontains(java.lang.String str, java.lang.String substr)
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.

strRequired

  • Type: java.lang.String

substrRequired

  • Type: java.lang.String

strrev

import io.cdktn.cdktn.Fn;

Fn.strrev(java.lang.String str)
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).

strRequired

  • Type: java.lang.String

substr

import io.cdktn.cdktn.Fn;

Fn.substr(java.lang.String str, java.lang.Number offset, java.lang.Number length)
substr extracts a substring from a given string by offset and (maximum) length.

strRequired

  • Type: java.lang.String

offsetRequired

  • Type: java.lang.Number

lengthRequired

  • Type: java.lang.Number

sum

import io.cdktn.cdktn.Fn;

Fn.sum(java.lang.Object list)
sum takes a list or set of numbers and returns the sum of those numbers.

listRequired

  • Type: java.lang.Object

templatefile

import io.cdktn.cdktn.Fn;

Fn.templatefile(java.lang.String path, java.lang.Object vars)
templatefile reads the file at the given path and renders its content as a template using a supplied set of template variables.

pathRequired

  • Type: java.lang.String

varsRequired

  • Type: java.lang.Object

textdecodebase64

import io.cdktn.cdktn.Fn;

Fn.textdecodebase64(java.lang.String source, java.lang.String encoding)
textdecodebase64 function decodes a string that was previously Base64-encoded, and then interprets the result as characters in a specified character encoding.

sourceRequired

  • Type: java.lang.String

encodingRequired

  • Type: java.lang.String

textencodebase64

import io.cdktn.cdktn.Fn;

Fn.textencodebase64(java.lang.String str, java.lang.String encoding)
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.

strRequired

  • Type: java.lang.String

encodingRequired

  • Type: java.lang.String

timeadd

import io.cdktn.cdktn.Fn;

Fn.timeadd(java.lang.String timestamp, java.lang.String duration)
timeadd adds a duration to a timestamp, returning a new timestamp.

timestampRequired

  • Type: java.lang.String

durationRequired

  • Type: java.lang.String

timecmp

import io.cdktn.cdktn.Fn;

Fn.timecmp(java.lang.String timestamp_a, java.lang.String timestamp_b)
timecmp compares two timestamps and returns a number that represents the ordering of the instants those timestamps represent.

timestamp_aRequired

  • Type: java.lang.String

timestamp_bRequired

  • Type: java.lang.String

timestamp

import io.cdktn.cdktn.Fn;

Fn.timestamp()
timestamp returns a UTC timestamp string in RFC 3339 format.

title

import io.cdktn.cdktn.Fn;

Fn.title(java.lang.String str)
title converts the first letter of each word in the given string to uppercase.

strRequired

  • Type: java.lang.String

tobool

import io.cdktn.cdktn.Fn;

Fn.tobool(java.lang.Object v)
tobool converts its argument to a boolean value.

vRequired

  • Type: java.lang.Object

tolist

import io.cdktn.cdktn.Fn;

Fn.tolist(java.lang.Object v)
tolist converts its argument to a list value.

vRequired

  • Type: java.lang.Object

tomap

import io.cdktn.cdktn.Fn;

Fn.tomap(java.lang.Object v)
tomap converts its argument to a map value.

vRequired

  • Type: java.lang.Object

tonumber

import io.cdktn.cdktn.Fn;

Fn.tonumber(java.lang.Object v)
tonumber converts its argument to a number value.

vRequired

  • Type: java.lang.Object

toset

import io.cdktn.cdktn.Fn;

Fn.toset(java.lang.Object v)
toset converts its argument to a set value.

vRequired

  • Type: java.lang.Object

tostring

import io.cdktn.cdktn.Fn;

Fn.tostring(java.lang.Object v)
tostring converts its argument to a string value.

vRequired

  • Type: java.lang.Object

transpose

import io.cdktn.cdktn.Fn;

Fn.transpose(java.lang.Object values)
transpose takes a map of lists of strings and swaps the keys and values to produce a new map of lists of strings.

valuesRequired

  • Type: java.lang.Object

trim

import io.cdktn.cdktn.Fn;

Fn.trim(java.lang.String str, java.lang.String cutset)
trim removes the specified set of characters from the start and end of the given string.

strRequired

  • Type: java.lang.String

cutsetRequired

  • Type: java.lang.String

trimprefix

import io.cdktn.cdktn.Fn;

Fn.trimprefix(java.lang.String str, java.lang.String prefix)
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.

strRequired

  • Type: java.lang.String

prefixRequired

  • Type: java.lang.String

trimspace

import io.cdktn.cdktn.Fn;

Fn.trimspace(java.lang.String str)
trimspace removes any space characters from the start and end of the given string.

strRequired

  • Type: java.lang.String

trimsuffix

import io.cdktn.cdktn.Fn;

Fn.trimsuffix(java.lang.String str, java.lang.String suffix)
trimsuffix removes the specified suffix from the end of the given string.

strRequired

  • Type: java.lang.String

suffixRequired

  • Type: java.lang.String

try

import io.cdktn.cdktn.Fn;

Fn.try(java.util.List<java.lang.Object> expressions)
try evaluates all of its argument expressions in turn and returns the result of the first one that does not produce any errors.

expressionsRequired

  • Type: java.util.List< java.lang.Object >

upper

import io.cdktn.cdktn.Fn;

Fn.upper(java.lang.String str)
upper converts all cased letters in the given string to uppercase.

strRequired

  • Type: java.lang.String

urlencode

import io.cdktn.cdktn.Fn;

Fn.urlencode(java.lang.String str)
urlencode applies URL encoding to a given string.

strRequired

  • Type: java.lang.String

uuid

import io.cdktn.cdktn.Fn;

Fn.uuid()
uuid generates a unique identifier string.

uuidv5

import io.cdktn.cdktn.Fn;

Fn.uuidv5(java.lang.String namespace, java.lang.String name)
uuidv5 generates a name-based UUID, as described in RFC 4122 section 4.3, also known as a “version 5” UUID.

namespaceRequired

  • Type: java.lang.String

nameRequired

  • Type: java.lang.String

values

import io.cdktn.cdktn.Fn;

Fn.values(java.lang.Object mapping)
values takes a map and returns a list containing the values of the elements in that map.

mappingRequired

  • Type: java.lang.Object

yamldecode

import io.cdktn.cdktn.Fn;

Fn.yamldecode(java.lang.String src)
yamldecode parses a string as a subset of YAML, and produces a representation of its value.

srcRequired

  • Type: java.lang.String

yamlencode

import io.cdktn.cdktn.Fn;

Fn.yamlencode(java.lang.Object value)
yamlencode encodes a given value to a string using YAML 1.2 block syntax.

valueRequired

  • Type: java.lang.Object

zipmap

import io.cdktn.cdktn.Fn;

Fn.zipmap(java.util.List<java.lang.String> keys, java.lang.Object values)
zipmap constructs a map from a list of keys and a corresponding list of values.

keysRequired

  • Type: java.util.List< java.lang.String >

valuesRequired

  • Type: java.lang.Object

bcrypt

import io.cdktn.cdktn.Fn;

Fn.bcrypt(java.lang.String str),Fn.bcrypt(java.lang.String str, java.lang.Number cost)
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.

strRequired

  • Type: java.lang.String

costOptional

  • Type: java.lang.Number

conditional

import io.cdktn.cdktn.Fn;

Fn.conditional(java.lang.Object condition, java.lang.Object trueValue, java.lang.Object falseValue)
https://developer.hashicorp.com/terraform/language/expressions/conditionals A conditional expression uses the value of a boolean expression to select one of two values.

conditionRequired

  • Type: java.lang.Object

trueValueRequired

  • Type: java.lang.Object

falseValueRequired

  • Type: java.lang.Object

join

import io.cdktn.cdktn.Fn;

Fn.join(java.lang.String separator, java.util.List<java.lang.String> list)
join produces a string by concatenating together all elements of a given list of strings with the given delimiter.

separatorRequired

  • Type: java.lang.String

listRequired

  • Type: java.util.List< java.lang.String >

lookup

import io.cdktn.cdktn.Fn;

Fn.lookup(java.lang.Object inputMap, java.lang.String key),Fn.lookup(java.lang.Object inputMap, java.lang.String key, java.lang.Object defaultValue)
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.

inputMapRequired

  • Type: java.lang.Object

keyRequired

  • Type: java.lang.String

defaultValueOptional

  • Type: java.lang.Object

lookupNested

import io.cdktn.cdktn.Fn;

Fn.lookupNested(java.lang.Object inputMap, java.util.List<java.lang.Object> path)
returns a property access expression that accesses the property at the given path in the given inputMap. For example lookupNested(x, [“a”, “b”, “c”]) will return a Terraform expression like x[“a”][“b”][“c”]

inputMapRequired

  • Type: java.lang.Object

pathRequired

  • Type: java.util.List< java.lang.Object >

range

import io.cdktn.cdktn.Fn;

Fn.range(java.lang.Number start, java.lang.Number limit),Fn.range(java.lang.Number start, java.lang.Number limit, java.lang.Number step)
range generates a list of numbers using a start value, a limit value, and a step value.

startRequired

  • Type: java.lang.Number

limitRequired

  • Type: java.lang.Number

stepOptional

  • Type: java.lang.Number

rawString

import io.cdktn.cdktn.Fn;

Fn.rawString(java.lang.String str)
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).

strRequired

  • Type: java.lang.String