Skip to content

Commit 8bfa7bf

Browse files
author
Alan O'Cais
committed
Add availability set to Azure to use IB
1 parent 8dde3d4 commit 8bfa7bf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

azure/infrastructure.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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
5665
resource "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)

0 commit comments

Comments
 (0)