Showing posts from May, 2020

Terraform Functions - Part 2 - Count

In part two of this blog series we will take a look at the count function in Terraform and see how we can use this with a basic Azure Web App deployment. In a future blog we will explore how to use the count function in a more complex resource deployment.  In part one we cover an overview of the blog series and some pre-requisites you will need to get started when working through the deployment steps in this blog series, if you haven't seen this information please review this  here before you get started with the steps below. The count function is very useful for easily deploying multiple resources of the same type and configuration. For example, we may need a web farm and all the Virtual Machines need the same configuration, using the count function we can deploy the same resource multiple times and include the count number in the name so we deploy web1, web2, web3. We can also use the count function when deploying the related resources NICs, IP addresses, disks etc. We can ea

Terraform Functions - Part 1 - For_Each

In this blog series we will explore some of the common Terraform functions that will be useful to know when deploying resources to Azure. With working demos you can follow along and deploy resources to your own Azure subscriptions and learn how these functions behave.  Knowing about these features and combining the use of them in your Terraform configurations will help as you make more advanced deployment templates and modules. This will be a four part series covering the following; Basic for_each demo Basic count demo Conditional expression demo Advanced count and conditional expression combined The assumption is you have an Azure subscription you can use to deploy these resource to. You have  installed terraform  version 0.12 minimum and are familiar with deploying basic resources to Azure using Terraform configurations. You will have the az cli installed and know how to authenticate to Azure using azure cli. We will be working with a local Terraform state file to keep things