Skip to main content

Initializers

import cdktn

cdktn.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.
length_oflength 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.
lookup_nestedreturns 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.
raw_stringUse 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 cdktn

cdktn.Fn.abs(
  num: typing.Union[int, float]
)
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: typing.Union[int, float]

abspath

import cdktn

cdktn.Fn.abspath(
  path: str
)
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: str

alltrue

import cdktn

cdktn.Fn.alltrue(
  list: typing.List[typing.Any]
)
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: typing.List[typing.Any]

anytrue

import cdktn

cdktn.Fn.anytrue(
  list: typing.List[typing.Any]
)
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: typing.List[typing.Any]

base64decode

import cdktn

cdktn.Fn.base64decode(
  str: str
)
base64decode takes a string containing a Base64 character sequence and returns the original string.

strRequired

  • Type: str

base64encode

import cdktn

cdktn.Fn.base64encode(
  str: str
)
base64encode applies Base64 encoding to a string.

strRequired

  • Type: str

base64gzip

import cdktn

cdktn.Fn.base64gzip(
  str: str
)
base64gzip compresses a string with gzip and then encodes the result in Base64 encoding.

strRequired

  • Type: str

base64sha256

import cdktn

cdktn.Fn.base64sha256(
  str: 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: str

base64sha512

import cdktn

cdktn.Fn.base64sha512(
  str: 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: str

basename

import cdktn

cdktn.Fn.basename(
  path: str
)
basename takes a string containing a filesystem path and removes all except the last portion from it.

pathRequired

  • Type: str

can

import cdktn

cdktn.Fn.can(
  expression: typing.Any
)
can evaluates the given expression and returns a boolean value indicating whether the expression produced a result without any errors.

expressionRequired

  • Type: typing.Any

ceil

import cdktn

cdktn.Fn.ceil(
  num: typing.Union[int, float]
)
ceil returns the closest whole number that is greater than or equal to the given value, which may be a fraction.

numRequired

  • Type: typing.Union[int, float]

chomp

import cdktn

cdktn.Fn.chomp(
  str: str
)
chomp removes newline characters at the end of a string.

strRequired

  • Type: str

chunklist

import cdktn

cdktn.Fn.chunklist(
  list: typing.List[typing.Any],
  size: typing.Union[int, float]
)
chunklist splits a single list into fixed-size chunks, returning a list of lists.

listRequired

  • Type: typing.List[typing.Any]

sizeRequired

  • Type: typing.Union[int, float]

cidrhost

import cdktn

cdktn.Fn.cidrhost(
  prefix: str,
  hostnum: typing.Union[int, float]
)
cidrhost calculates a full host IP address for a given host number within a given IP network address prefix.

prefixRequired

  • Type: str

hostnumRequired

  • Type: typing.Union[int, float]

cidrnetmask

import cdktn

cdktn.Fn.cidrnetmask(
  prefix: str
)
cidrnetmask converts an IPv4 address prefix given in CIDR notation into a subnet mask address.

prefixRequired

  • Type: str

cidrsubnet

import cdktn

cdktn.Fn.cidrsubnet(
  prefix: str,
  newbits: typing.Union[int, float],
  netnum: typing.Union[int, float]
)
cidrsubnet calculates a subnet address within given IP network address prefix.

prefixRequired

  • Type: str

newbitsRequired

  • Type: typing.Union[int, float]

netnumRequired

  • Type: typing.Union[int, float]

cidrsubnets

import cdktn

cdktn.Fn.cidrsubnets(
  prefix: str,
  newbits: typing.List[typing.Union[int, float]]
)
cidrsubnets calculates a sequence of consecutive IP address ranges within a particular CIDR prefix.

prefixRequired

  • Type: str

newbitsRequired

  • Type: typing.List[typing.Union[int, float]]

coalesce

import cdktn

cdktn.Fn.coalesce(
  vals: typing.List[typing.Any]
)
coalesce takes any number of arguments and returns the first one that isn’t null or an empty string.

valsRequired

  • Type: typing.List[typing.Any]

coalescelist

import cdktn

cdktn.Fn.coalescelist(
  vals: typing.List[typing.Any]
)
coalescelist takes any number of list arguments and returns the first one that isn’t empty.

valsRequired

  • Type: typing.List[typing.Any]

compact

import cdktn

cdktn.Fn.compact(
  list: typing.List[str]
)
compact takes a list of strings and returns a new list with any empty string elements removed.

listRequired

  • Type: typing.List[str]

concat

import cdktn

cdktn.Fn.concat(
  seqs: typing.List[typing.Any]
)
concat takes two or more lists and combines them into a single list.

seqsRequired

  • Type: typing.List[typing.Any]

contains

import cdktn

cdktn.Fn.contains(
  list: typing.Any,
  value: typing.Any
)
contains determines whether a given list or set contains a given single value as one of its elements.

listRequired

  • Type: typing.Any

valueRequired

  • Type: typing.Any

csvdecode

import cdktn

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

strRequired

  • Type: str

dirname

import cdktn

cdktn.Fn.dirname(
  path: str
)
dirname takes a string containing a filesystem path and removes the last portion from it.

pathRequired

  • Type: str

distinct

import cdktn

cdktn.Fn.distinct(
  list: typing.List[typing.Any]
)
distinct takes a list and returns a new list with any duplicate elements removed.

listRequired

  • Type: typing.List[typing.Any]

element

import cdktn

cdktn.Fn.element(
  list: typing.Any,
  index: typing.Union[int, float]
)
element retrieves a single element from a list.

listRequired

  • Type: typing.Any

indexRequired

  • Type: typing.Union[int, float]

endswith

import cdktn

cdktn.Fn.endswith(
  str: str,
  suffix: str
)
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: str

suffixRequired

  • Type: str

file

import cdktn

cdktn.Fn.file(
  path: str
)
file reads the contents of a file at the given path and returns them as a string.

pathRequired

  • Type: str

filebase64

import cdktn

cdktn.Fn.filebase64(
  path: str
)
filebase64 reads the contents of a file at the given path and returns them as a base64-encoded string.

pathRequired

  • Type: str

filebase64sha256

import cdktn

cdktn.Fn.filebase64sha256(
  path: str
)
filebase64sha256 is a variant of base64sha256 that hashes the contents of a given file rather than a literal string.

pathRequired

  • Type: str

filebase64sha512

import cdktn

cdktn.Fn.filebase64sha512(
  path: str
)
filebase64sha512 is a variant of base64sha512 that hashes the contents of a given file rather than a literal string.

pathRequired

  • Type: str

fileexists

import cdktn

cdktn.Fn.fileexists(
  path: str
)
fileexists determines whether a file exists at a given path.

pathRequired

  • Type: str

filemd5

import cdktn

cdktn.Fn.filemd5(
  path: str
)
filemd5 is a variant of md5 that hashes the contents of a given file rather than a literal string.

pathRequired

  • Type: str

fileset

import cdktn

cdktn.Fn.fileset(
  path: str,
  pattern: str
)
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: str

patternRequired

  • Type: str

filesha1

import cdktn

cdktn.Fn.filesha1(
  path: str
)
filesha1 is a variant of sha1 that hashes the contents of a given file rather than a literal string.

pathRequired

  • Type: str

filesha256

import cdktn

cdktn.Fn.filesha256(
  path: str
)
filesha256 is a variant of sha256 that hashes the contents of a given file rather than a literal string.

pathRequired

  • Type: str

filesha512

import cdktn

cdktn.Fn.filesha512(
  path: str
)
filesha512 is a variant of sha512 that hashes the contents of a given file rather than a literal string.

pathRequired

  • Type: str

flatten

import cdktn

cdktn.Fn.flatten(
  list: typing.Any
)
flatten takes a list and replaces any elements that are lists with a flattened sequence of the list contents.

listRequired

  • Type: typing.Any

floor

import cdktn

cdktn.Fn.floor(
  num: typing.Union[int, float]
)
floor returns the closest whole number that is less than or equal to the given value, which may be a fraction.

numRequired

  • Type: typing.Union[int, float]

format

import cdktn

cdktn.Fn.format(
  format: str,
  args: typing.List[typing.Any]
)
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: str

argsRequired

  • Type: typing.List[typing.Any]

formatdate

import cdktn

cdktn.Fn.formatdate(
  format: str,
  time: str
)
formatdate converts a timestamp into a different time format.

formatRequired

  • Type: str

timeRequired

  • Type: str

formatlist

import cdktn

cdktn.Fn.formatlist(
  format: str,
  args: typing.List[typing.Any]
)
formatlist produces a list of strings by formatting a number of other values according to a specification string.

formatRequired

  • Type: str

argsRequired

  • Type: typing.List[typing.Any]

indent

import cdktn

cdktn.Fn.indent(
  spaces: typing.Union[int, float],
  str: 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: typing.Union[int, float]

strRequired

  • Type: str

index

import cdktn

cdktn.Fn.index(
  list: typing.Any,
  value: typing.Any
)
index finds the element index for a given value in a list.

listRequired

  • Type: typing.Any

valueRequired

  • Type: typing.Any

jsondecode

import cdktn

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

strRequired

  • Type: str

jsonencode

import cdktn

cdktn.Fn.jsonencode(
  val: typing.Any
)
jsonencode encodes a given value to a string using JSON syntax.

valRequired

  • Type: typing.Any

keys

import cdktn

cdktn.Fn.keys(
  input_map: typing.Any
)
keys takes a map and returns a list containing the keys from that map.

input_mapRequired

  • Type: typing.Any

length_of

import cdktn

cdktn.Fn.length_of(
  value: typing.Any
)
length determines the length of a given list, map, or string.

valueRequired

  • Type: typing.Any

log

import cdktn

cdktn.Fn.log(
  num: typing.Union[int, float],
  base: typing.Union[int, float]
)
log returns the logarithm of a given number in a given base.

numRequired

  • Type: typing.Union[int, float]

baseRequired

  • Type: typing.Union[int, float]

lower

import cdktn

cdktn.Fn.lower(
  str: str
)
lower converts all cased letters in the given string to lowercase.

strRequired

  • Type: str

matchkeys

import cdktn

cdktn.Fn.matchkeys(
  values: typing.List[typing.Any],
  keys: typing.List[typing.Any],
  searchset: typing.List[typing.Any]
)
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: typing.List[typing.Any]

keysRequired

  • Type: typing.List[typing.Any]

searchsetRequired

  • Type: typing.List[typing.Any]

max

import cdktn

cdktn.Fn.max(
  numbers: typing.List[typing.Union[int, float]]
)
max takes one or more numbers and returns the greatest number from the set.

numbersRequired

  • Type: typing.List[typing.Union[int, float]]

md5

import cdktn

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

strRequired

  • Type: str

merge

import cdktn

cdktn.Fn.merge(
  maps: typing.List[typing.Any]
)
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: typing.List[typing.Any]

min

import cdktn

cdktn.Fn.min(
  numbers: typing.List[typing.Union[int, float]]
)
min takes one or more numbers and returns the smallest number from the set.

numbersRequired

  • Type: typing.List[typing.Union[int, float]]

nonsensitive

import cdktn

cdktn.Fn.nonsensitive(
  value: typing.Any
)
nonsensitive takes a sensitive value and returns a copy of that value with the sensitive marking removed, thereby exposing the sensitive value.

valueRequired

  • Type: typing.Any

one

import cdktn

cdktn.Fn.one(
  list: typing.Any
)
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: typing.Any

parseint

import cdktn

cdktn.Fn.parseint(
  number: typing.Any,
  base: typing.Union[int, float]
)
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: typing.Any

baseRequired

  • Type: typing.Union[int, float]

pathexpand

import cdktn

cdktn.Fn.pathexpand(
  path: str
)
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: str

plantimestamp

import cdktn

cdktn.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 cdktn

cdktn.Fn.pow(
  num: typing.Union[int, float],
  power: typing.Union[int, float]
)
pow calculates an exponent, by raising its first argument to the power of the second argument.

numRequired

  • Type: typing.Union[int, float]

powerRequired

  • Type: typing.Union[int, float]

regex

import cdktn

cdktn.Fn.regex(
  pattern: str,
  str: str
)
regex applies a regular expression to a string and returns the matching substrings.

patternRequired

  • Type: str

strRequired

  • Type: str

regexall

import cdktn

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

patternRequired

  • Type: str

strRequired

  • Type: str

replace

import cdktn

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

strRequired

  • Type: str

substrRequired

  • Type: str

replaceRequired

  • Type: str

reverse

import cdktn

cdktn.Fn.reverse(
  list: typing.Any
)
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: typing.Any

rsadecrypt

import cdktn

cdktn.Fn.rsadecrypt(
  ciphertext: str,
  privatekey: str
)
rsadecrypt decrypts an RSA-encrypted ciphertext, returning the corresponding cleartext.

ciphertextRequired

  • Type: str

privatekeyRequired

  • Type: str

sensitive

import cdktn

cdktn.Fn.sensitive(
  value: typing.Any
)
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: typing.Any

setintersection

import cdktn

cdktn.Fn.setintersection(
  first_set: typing.List[typing.Any],
  other_sets: typing.List[typing.List[typing.Any]]
)
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: typing.List[typing.Any]

other_setsRequired

  • Type: typing.List[typing.List[typing.Any]]

setproduct

import cdktn

cdktn.Fn.setproduct(
  sets: typing.List[typing.Any]
)
The setproduct function finds all of the possible combinations of elements from all of the given sets by computing the Cartesian product.

setsRequired

  • Type: typing.List[typing.Any]

setsubtract

import cdktn

cdktn.Fn.setsubtract(
  a: typing.List[typing.Any],
  b: typing.List[typing.Any]
)
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: typing.List[typing.Any]

bRequired

  • Type: typing.List[typing.Any]

setunion

import cdktn

cdktn.Fn.setunion(
  first_set: typing.List[typing.Any],
  other_sets: typing.List[typing.List[typing.Any]]
)
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: typing.List[typing.Any]

other_setsRequired

  • Type: typing.List[typing.List[typing.Any]]

sha1

import cdktn

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

strRequired

  • Type: str

sha256

import cdktn

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

strRequired

  • Type: str

sha512

import cdktn

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

strRequired

  • Type: str

signum

import cdktn

cdktn.Fn.signum(
  num: typing.Union[int, float]
)
signum determines the sign of a number, returning a number between -1 and 1 to represent the sign.

numRequired

  • Type: typing.Union[int, float]

slice

import cdktn

cdktn.Fn.slice(
  list: typing.Any,
  start_index: typing.Union[int, float],
  end_index: typing.Union[int, float]
)
slice extracts some consecutive elements from within a list.

listRequired

  • Type: typing.Any

start_indexRequired

  • Type: typing.Union[int, float]

end_indexRequired

  • Type: typing.Union[int, float]

sort

import cdktn

cdktn.Fn.sort(
  list: typing.List[str]
)
sort takes a list of strings and returns a new list with those strings sorted lexicographically.

listRequired

  • Type: typing.List[str]

split

import cdktn

cdktn.Fn.split(
  separator: str,
  str: str
)
split produces a list by dividing a given string at all occurrences of a given separator.

separatorRequired

  • Type: str

strRequired

  • Type: str

startswith

import cdktn

cdktn.Fn.startswith(
  str: str,
  prefix: str
)
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: str

prefixRequired

  • Type: str

strcontains

import cdktn

cdktn.Fn.strcontains(
  str: str,
  substr: str
)
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: str

substrRequired

  • Type: str

strrev

import cdktn

cdktn.Fn.strrev(
  str: 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: str

substr

import cdktn

cdktn.Fn.substr(
  str: str,
  offset: typing.Union[int, float],
  length: typing.Union[int, float]
)
substr extracts a substring from a given string by offset and (maximum) length.

strRequired

  • Type: str

offsetRequired

  • Type: typing.Union[int, float]

lengthRequired

  • Type: typing.Union[int, float]

sum

import cdktn

cdktn.Fn.sum(
  list: typing.Any
)
sum takes a list or set of numbers and returns the sum of those numbers.

listRequired

  • Type: typing.Any

templatefile

import cdktn

cdktn.Fn.templatefile(
  path: str,
  vars: typing.Any
)
templatefile reads the file at the given path and renders its content as a template using a supplied set of template variables.

pathRequired

  • Type: str

varsRequired

  • Type: typing.Any

textdecodebase64

import cdktn

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

sourceRequired

  • Type: str

encodingRequired

  • Type: str

textencodebase64

import cdktn

cdktn.Fn.textencodebase64(
  str: str,
  encoding: str
)
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: str

encodingRequired

  • Type: str

timeadd

import cdktn

cdktn.Fn.timeadd(
  timestamp: str,
  duration: str
)
timeadd adds a duration to a timestamp, returning a new timestamp.

timestampRequired

  • Type: str

durationRequired

  • Type: str

timecmp

import cdktn

cdktn.Fn.timecmp(
  timestamp_a: str,
  timestamp_b: str
)
timecmp compares two timestamps and returns a number that represents the ordering of the instants those timestamps represent.

timestamp_aRequired

  • Type: str

timestamp_bRequired

  • Type: str

timestamp

import cdktn

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

title

import cdktn

cdktn.Fn.title(
  str: str
)
title converts the first letter of each word in the given string to uppercase.

strRequired

  • Type: str

tobool

import cdktn

cdktn.Fn.tobool(
  v: typing.Any
)
tobool converts its argument to a boolean value.

vRequired

  • Type: typing.Any

tolist

import cdktn

cdktn.Fn.tolist(
  v: typing.Any
)
tolist converts its argument to a list value.

vRequired

  • Type: typing.Any

tomap

import cdktn

cdktn.Fn.tomap(
  v: typing.Any
)
tomap converts its argument to a map value.

vRequired

  • Type: typing.Any

tonumber

import cdktn

cdktn.Fn.tonumber(
  v: typing.Any
)
tonumber converts its argument to a number value.

vRequired

  • Type: typing.Any

toset

import cdktn

cdktn.Fn.toset(
  v: typing.Any
)
toset converts its argument to a set value.

vRequired

  • Type: typing.Any

tostring

import cdktn

cdktn.Fn.tostring(
  v: typing.Any
)
tostring converts its argument to a string value.

vRequired

  • Type: typing.Any

transpose

import cdktn

cdktn.Fn.transpose(
  values: typing.Any
)
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: typing.Any

trim

import cdktn

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

strRequired

  • Type: str

cutsetRequired

  • Type: str

trimprefix

import cdktn

cdktn.Fn.trimprefix(
  str: str,
  prefix: str
)
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: str

prefixRequired

  • Type: str

trimspace

import cdktn

cdktn.Fn.trimspace(
  str: str
)
trimspace removes any space characters from the start and end of the given string.

strRequired

  • Type: str

trimsuffix

import cdktn

cdktn.Fn.trimsuffix(
  str: str,
  suffix: str
)
trimsuffix removes the specified suffix from the end of the given string.

strRequired

  • Type: str

suffixRequired

  • Type: str

try

import cdktn

cdktn.Fn.try(
  expressions: typing.List[typing.Any]
)
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: typing.List[typing.Any]

upper

import cdktn

cdktn.Fn.upper(
  str: str
)
upper converts all cased letters in the given string to uppercase.

strRequired

  • Type: str

urlencode

import cdktn

cdktn.Fn.urlencode(
  str: str
)
urlencode applies URL encoding to a given string.

strRequired

  • Type: str

uuid

import cdktn

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

uuidv5

import cdktn

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

namespaceRequired

  • Type: str

nameRequired

  • Type: str

values

import cdktn

cdktn.Fn.values(
  mapping: typing.Any
)
values takes a map and returns a list containing the values of the elements in that map.

mappingRequired

  • Type: typing.Any

yamldecode

import cdktn

cdktn.Fn.yamldecode(
  src: str
)
yamldecode parses a string as a subset of YAML, and produces a representation of its value.

srcRequired

  • Type: str

yamlencode

import cdktn

cdktn.Fn.yamlencode(
  value: typing.Any
)
yamlencode encodes a given value to a string using YAML 1.2 block syntax.

valueRequired

  • Type: typing.Any

zipmap

import cdktn

cdktn.Fn.zipmap(
  keys: typing.List[str],
  values: typing.Any
)
zipmap constructs a map from a list of keys and a corresponding list of values.

keysRequired

  • Type: typing.List[str]

valuesRequired

  • Type: typing.Any

bcrypt

import cdktn

cdktn.Fn.bcrypt(
  str: str,
  cost: typing.Union[int, float] = None
)
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: str

costOptional

  • Type: typing.Union[int, float]

conditional

import cdktn

cdktn.Fn.conditional(
  condition: typing.Any,
  true_value: typing.Any,
  false_value: typing.Any
)
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: typing.Any

true_valueRequired

  • Type: typing.Any

false_valueRequired

  • Type: typing.Any

join

import cdktn

cdktn.Fn.join(
  separator: str,
  list: typing.List[str]
)
join produces a string by concatenating together all elements of a given list of strings with the given delimiter.

separatorRequired

  • Type: str

listRequired

  • Type: typing.List[str]

lookup

import cdktn

cdktn.Fn.lookup(
  input_map: typing.Any,
  key: str,
  default_value: typing.Any = None
)
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.

input_mapRequired

  • Type: typing.Any

keyRequired

  • Type: str

default_valueOptional

  • Type: typing.Any

lookup_nested

import cdktn

cdktn.Fn.lookup_nested(
  input_map: typing.Any,
  path: typing.List[typing.Any]
)
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”]

input_mapRequired

  • Type: typing.Any

pathRequired

  • Type: typing.List[typing.Any]

range

import cdktn

cdktn.Fn.range(
  start: typing.Union[int, float],
  limit: typing.Union[int, float],
  step: typing.Union[int, float] = None
)
range generates a list of numbers using a start value, a limit value, and a step value.

startRequired

  • Type: typing.Union[int, float]

limitRequired

  • Type: typing.Union[int, float]

stepOptional

  • Type: typing.Union[int, float]

raw_string

import cdktn

cdktn.Fn.raw_string(
  str: 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: str