File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,15 @@ resource "azurerm_resource_group" "group" {
5252 location = var. location
5353}
5454
55+ # Create an availability set for the execution nodes
56+ resource "azurerm_availability_set" "avset" {
57+ name = " ${ var . cluster_name } _availability_set"
58+ location = var. location
59+ resource_group_name = local. resource_group_name
60+ platform_update_domain_count = 1
61+ platform_fault_domain_count = 1
62+ }
63+
5564# Create virtual machine
5665resource "azurerm_linux_virtual_machine" "instances" {
5766 for_each = module. design . instances
@@ -60,6 +69,7 @@ resource "azurerm_linux_virtual_machine" "instances" {
6069 location = var. location
6170 resource_group_name = local. resource_group_name
6271 network_interface_ids = [azurerm_network_interface . nic [each . key ]. id ]
72+ availability_set_id = contains (each. value [" tags" ], " node" ) ? azurerm_availability_set. avset . id : null
6373
6474 os_disk {
6575 name = format (" %s-%s-disk" , var. cluster_name , each. key )
You can’t perform that action at this time.
0 commit comments