terraform

Creating Terraform Conditional resource based on mapped key.

Let’s create a conditional resource in Terraform based on a mapped key. Following post used for reference: https://medium.com/@business_99069/terraform-conditional-resources-based-on-a-map-key-a37fd329d3a1 Start with a map data structure in our variable.tfvars: Create a conditional azurerm_network_interface_backend_address_pool_assocation resource based on the value of the “docker_role” key in the above map. The lookup used in the logic below will only return true …

Creating Terraform Conditional resource based on mapped key. Read More »

Dealing with conditional Terraform Resources on Azure using Availability Sets

Sometimes when you are defining infrastructure with Terraform you run into issues that start to require conditional resources. Consider the following problem: You have a virtual machine cluster running in 3 environments in Azure, Test Staging Production These 3 environments are made up of the following resources — Azure Virtual Machine Resource Azure Availability Set …

Dealing with conditional Terraform Resources on Azure using Availability Sets Read More »