Functions | Terraform

Always learning
12 min read4 hours ago

Terraform functions are built-in, reusable code blocks that perform specific tasks within Terraform configurations.

The Terraform language does not support user-defined functions, so only the functions built into the language are available for use.

A built-in function is a function that is already available in a programming language, application, or another tool that can be accessed by end users.

Supported built-in functions

☑ abs(float)

☑ file(path), floor(float), formatlist(format, args, …)

☑ indent(numspaces, string), join(delim, list)

☑ keys(map), length(list), list(items, …), map(key, value, …)

☑ replace(string, search, replace), slice(list, from, to)

☑ split(delim, string), timestamp()

☑ values(map)

Types of Functions

  • Numeric
  • String
  • Collection
  • Encoding
  • File system
  • Date & Time
  • Hash & Crypto

Read more function-type

Key Concepts

--

--

Always learning
Always learning

Written by Always learning

கற்றுக் கொள்ளும் மாணவன்...

No responses yet