package
1.12.0-alpha20250213
Repository: https://github.com/hashicorp/terraform.git
Documentation: pkg.go.dev
# Functions
AllTrue returns true if all elements of the list are true.
AnyTrue returns true if any element of the list is true.
Base64Decode decodes a string containing a base64 sequence.
Base64Encode applies Base64 encoding to a string.
Base64Gzip compresses a string with gzip and then encodes the result in Base64 encoding.
Base64Sha256 computes the SHA256 hash of a given string and encodes it with Base64.
Base64Sha512 computes the SHA512 hash of a given string and encodes it with Base64.
Basename takes a string containing a filesystem path and removes all except the last portion from it.
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.
CidrHost calculates a full host IP address within a given IP network address prefix.
CidrNetmask converts an IPv4 address prefix given in CIDR notation into a subnet mask address.
CidrSubnet calculates a subnet address within a given IP network address prefix.
CidrSubnets calculates a sequence of consecutive subnet prefixes that may be of different prefix lengths under a common base prefix.
Coalesce takes any number of arguments and returns the first one that isn't empty.
Dirname takes a string containing a filesystem path and removes the last portion from it.
No description provided by the author
File reads the contents of the file at the given path.
FileBase64 reads the contents of the file at the given path.
FileExists determines whether a file exists at the given path.
FileSet enumerates a set of files given a glob pattern
The underlying function implementation works relative to a particular base directory, so this wrapper takes a base directory string and uses it to construct the underlying function before calling it.
Index finds the element index for a given value in a list.
No description provided by the author
Length returns the number of elements in the given collection or number of Unicode characters in the given string.
List takes any number of arguments of types that can unify into a single type and returns a list containing those values in the same order, or returns an error if there is no single element type that all values can convert to.
Log returns returns the logarithm of a given number in a given base.
Lookup performs a dynamic lookup into a map.
MakeFileBase64Sha256Func constructs a function that is like Base64Sha256Func but reads the contents of a file rather than hashing a given literal string.
MakeFileBase64Sha512Func constructs a function that is like Base64Sha512Func but reads the contents of a file rather than hashing a given literal string.
MakeFileExistsFunc constructs a function that takes a path and determines whether a file exists at that path.
MakeFileFunc constructs a function that takes a file path and returns the contents of that file, either directly as a string (where valid UTF-8 is required) or as a string containing base64 bytes.
MakeFileMd5Func constructs a function that is like Md5Func but reads the contents of a file rather than hashing a given literal string.
MakeFileSetFunc constructs a function that takes a glob pattern and enumerates a file set from that pattern.
MakeFileSha1Func constructs a function that is like Sha1Func but reads the contents of a file rather than hashing a given literal string.
MakeFileSha256Func constructs a function that is like Sha256Func but reads the contents of a file rather than hashing a given literal string.
MakeFileSha512Func constructs a function that is like Sha512Func but reads the contents of a file rather than hashing a given literal string.
MakeStaticTimestampFunc constructs a function that returns a string representation of the date and time specified by the provided argument.
MakeTemplateFileFunc constructs a function that takes a file path and an arbitrary object of named values and attempts to render the referenced file as a template using HCL template syntax.
TemplateStringFunc renders a template presented either as a literal string or as a reference to a string from elsewhere.
MakeToFunc constructs a "to..." function, like "tostring", which converts its argument to a specific type or type kind.
Map takes an even number of arguments and returns a map whose elements are constructed from consecutive pairs of arguments.
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.
Md5 computes the MD5 hash of a given string and encodes it with hexadecimal digits.
No description provided by the author
One returns either the first element of a one-element list, or null if given a zero-element list..
ParseInt parses a string argument and returns an integer of the specified base.
Pathexpand takes a string that might begin with a `~` segment, and if so it replaces that segment with the current user's home directory path.
Pow returns the logarithm of a given number in a given base.
Replace searches a given string for another given substring, and replaces all occurences with a given replacement string.
RsaDecrypt decrypts an RSA-encrypted ciphertext, returning the corresponding cleartext.
No description provided by the author
Sha1 computes the SHA1 hash of a given string and encodes it with hexadecimal digits.
Sha256 computes the SHA256 hash of a given string and encodes it with hexadecimal digits.
Sha512 computes the SHA512 hash of a given string and encodes it with hexadecimal digits.
Signum determines the sign of a number, returning a number between -1 and 1 to represent the sign.
No description provided by the author
Sum adds numbers in a list, set, or tuple.
TextDecodeBase64 decodes a string containing a base64 sequence whereas a specific encoding of the string is expected.
TextEncodeBase64 applies Base64 encoding to a string that was encoded before with a target encoding.
TimeAdd adds a duration to a timestamp, returning a new timestamp.
TimeCmp compares two timestamps, indicating whether they are equal or if one is before the other.
Timestamp returns a string representation of the current date and time.
Transpose takes a map of lists of strings and swaps the keys and values to produce a new map of lists of strings.
No description provided by the author
URLEncode applies URL encoding to a given string.
UUID generates and returns a Type-4 UUID in the standard hexadecimal string format.
UUIDV5 generates and returns a Type-5 UUID in the standard hexadecimal string format.
WithDescription looks up the description for a given function and uses go-cty's WithNewDescriptions to replace the function's description and parameter descriptions.
# Variables
AbsPathFunc constructs a function that converts a filesystem path to an absolute path.
AllTrueFunc constructs a function that returns true if all elements of the list are true.
AnyTrueFunc constructs a function that returns true if any element of the list is true.
Base64DecodeFunc constructs a function that decodes a string containing a base64 sequence.
Base64EncodeFunc constructs a function that encodes a string to a base64 sequence.
Base64GzipFunc constructs a function that compresses a string with gzip and then encodes the result in Base64 encoding.
Base64Sha256Func constructs a function that computes the SHA256 hash of a given string and encodes it with Base64.
Base64Sha512Func constructs a function that computes the SHA256 hash of a given string and encodes it with Base64.
BasenameFunc constructs a function that takes a string containing a filesystem path and removes all except the last portion from it.
BcryptFunc constructs a function that computes a hash of the given string using the Blowfish cipher.
CidrHostFunc contructs a function that calculates a full host IP address within a given IP network address prefix.
CidrNetmaskFunc contructs a function that converts an IPv4 address prefix given in CIDR notation into a subnet mask address.
CidrSubnetFunc contructs a function that calculates a subnet address within a given IP network address prefix.
CidrSubnetsFunc is similar to CidrSubnetFunc but calculates many consecutive subnet addresses at once, rather than just a single subnet extension.
CoalesceFunc constructs a function that takes any number of arguments and returns the first one that isn't empty.
DescriptionList is a consolidated list containing all descriptions for all functions available within Terraform.
DirnameFunc constructs a function that takes a string containing a filesystem path and removes the last portion from it.
EndsWithFunc constructs a function that checks if a string ends with a specific suffix using strings.HasSuffix.
EphemeralAsNullFunc is a cty function that takes a value of any type and returns a similar value with any ephemeral-marked values anywhere in the structure replaced with a null value of the same type that is not marked as ephemeral.
IndexFunc constructs a function that finds the element index for a given value in a list.
No description provided by the author
No description provided by the author
ListFunc constructs a function that takes an arbitrary number of arguments and returns a list containing those values in the same order.
LogFunc contructs a function that returns the logarithm of a given number in a given base.
LookupFunc constructs a function that performs dynamic lookups of map types.
MapFunc constructs a function that takes an even number of arguments and returns a map whose elements are constructed from consecutive pairs of arguments.
MatchkeysFunc constructs a function that constructs a new list by taking a subset of elements from one list whose indexes match the corresponding indexes of values in another list.
Md5Func constructs a function that computes the MD5 hash of a given string and encodes it with hexadecimal digits.
NonsensitiveFunc takes a sensitive value and returns the same value without the sensitive marking, effectively exposing the value.
OneFunc returns either the first element of a one-element list, or null if given a zero-element list.
ParseIntFunc contructs a function that parses a string argument and returns an integer of the specified base.
PathExpandFunc constructs a function that expands a leading ~ character to the current user's home directory.
PowFunc contructs a function that returns the logarithm of a given number in a given base.
ReplaceFunc constructs a function that searches a given string for another given substring, and replaces each occurence with a given replacement string.
RsaDecryptFunc constructs a function that decrypts an RSA-encrypted ciphertext.
SensitiveFunc returns a value identical to its argument except that Terraform will consider it to be sensitive.
Sha1Func contructs a function that computes the SHA1 hash of a given string and encodes it with hexadecimal digits.
Sha256Func contructs a function that computes the SHA256 hash of a given string and encodes it with hexadecimal digits.
Sha512Func contructs a function that computes the SHA512 hash of a given string and encodes it with hexadecimal digits.
SignumFunc contructs a function that returns the closest whole number greater than or equal to the given value.
StartsWithFunc constructs a function that checks if a string starts with a specific prefix using strings.HasPrefix.
StrContainsFunc searches a given string for another given substring, if found the function returns true, otherwise returns false.
SumFunc constructs a function that returns the sum of all numbers provided in a list.
TextDecodeBase64Func constructs a function that decodes a base64 sequence to a target encoding.
TextEncodeBase64Func constructs a function that encodes a string to a target encoding and then to a base64 sequence.
TimeAddFunc constructs a function that adds a duration to a timestamp, returning a new timestamp.
TimeCmpFunc is a function that compares two timestamps.
TimestampFunc constructs a function that returns a string representation of the current date and time.
TransposeFunc constructs a function that takes a map of lists of strings and swaps the keys and values to produce a new map of lists of strings.
TypeFunc returns an encapsulated value containing its argument's type.
URLEncodeFunc constructs a function that applies URL encoding to a given string.
No description provided by the author
No description provided by the author