There are a lot of built-in functions available in Terraform to use. These built-in functions can improve your code and its readability. So let's get started with some of the built-in functions that can be beneficial for you while writing terraform code. 1. Can Function can function evaluates the given expression and returns a boolean value. Return value would be 'true', if the expression produces a result without any errors otherwise it will return 'false'. The primary purpose of can function is to turn an error condition into a boolean validation result when writing custom variable validation rules. Let's take a look at a few examples to understand the working of can function. variable "eip_name" { type = string default = "eip-test" validation { condition = can( regex ( "^eip-" , var . eip_name )) error_message = "The external IP name must be a valid name starting with \" eip- \" ....