Functions
HCL includes dozens of functions that you can use to help develop your infrastructure with Terraform. However, I don’t plan on draining the ocean on every single function because I think many of them cover concepts that are outside the scope of this book. I will focus on the most pertinent and practical functions of developing excellent cloud infrastructure. Another exciting new feature that is available in Terraform 1.8.0 is the introduction of provider-specific functions. This allows provider authors (e.g., aws
, azurerm
, etc.) to create functions that provide useful functionality that is specific for that provider. This could be for common utilities such as parsing and AWS ARN or an Azure Resource Identifier.
Numeric functions
Numeric functions operate on objects of the number
type. The usual suspects are present—everything from absolute value, ceiling/floor, min/max, and so on.
Given that these functions cover fundamental concepts in math, they are...