I’m hoping someone will be able to point me in the right direction of how to place a VM into an Azure zone. This is easy when it’s just one VM you’re deploying but I’m doing a count to deploy 5 VMs and would like to spread them out over 3 Azure zones. For example, 2 in Zone 1, 2 in zone 2 and 1 in zone 3.
The Zone parameter is a ‘list of a single item’ there a way to on each iteration of the loop (using count =5) to set the zone?
Example code:
resource “azurerm_virtual_machine” “vm_app_servers” {
count = “${var.Number_of_App_Machines}”
zones = [" "] # This needs to be the zone number.
If I did something like this: zones = [“1”, “2”]
I get the error - Error: zones: attribute supports 1 item maximum, config has 2 declared. So I need a way to specify the zone.
Hope that makes sense?
Thanks, Joe