Terraform – Function of the Day – Let’s Go!
As a frequent user of Terraform, I’ve found that the documentation is good, but I feel that it could do a better job of explaining how to use the various functions included in the interpolation engine. In this series of posts I am going to document a different Terraform function each day and how you might use it. This won’t require using a provider per se. I’m just going to use variables, the null resource, and outputs to work through these functions. During the course of these posts I am also going to include the examples on GitHub, so you can pull the code whenever you want. So without further ado, let’s get started!
Before we dive into functions here’s my basic setup. I am running Terraform 0.11.7 on a Windows 10 (1804) laptop. The GitHub repo I’ll be referencing is
here. The functions I am going to run through are on the Terraform docs site here. I’ll be going through in alphabetical order, so abs() will be the first entry. That’s really it. I don’t want to over-complicate this, so let’s go!