Skip to content

Commit

Permalink
feat: (PSKD-801) Allow users to provision a minimum of 1 TB Azure Net…
Browse files Browse the repository at this point in the history
…App storage
  • Loading branch information
riragh committed Nov 19, 2024
1 parent 48ca24a commit 74be2dd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions modules/azurerm_netapp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ resource "azurerm_netapp_pool" "anf" {
service_level = var.service_level
size_in_tb = var.size_in_tb
tags = var.tags

lifecycle {
precondition {
condition = var.size_in_tb == 1 && var.network_features != "Standard"
error_message = "You can only take advantage of the 1-TiB minimum if all the volumes in the capacity pool are using Standard network features. If any volume is using Basic network features, the minimum size is 4 TiB."
}
}

}

resource "azurerm_netapp_volume" "anf" {
Expand Down
2 changes: 1 addition & 1 deletion modules/azurerm_netapp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ variable "service_level" {
}

variable "size_in_tb" {
description = "Provisioned size of the pool in TB. Value must be between 4 and 500"
description = "Provisioned size of the pool in TB. Value must be between 1 and 2048"
type = number
}

Expand Down
6 changes: 3 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,13 @@ variable "netapp_service_level" {
}

variable "netapp_size_in_tb" {
description = "When storage_type=ha, Provisioned size of the pool in TB. Value must be between 4 and 500"
description = "When storage_type=ha, Provisioned size of the pool in TB. Value must be between 1 and 2048. You can only take advantage of the 1-TiB minimum if all the volumes in the capacity pool are using Standard network features."
type = number
default = 4

validation {
condition = var.netapp_size_in_tb != null ? var.netapp_size_in_tb >= 4 && var.netapp_size_in_tb <= 500 : null
error_message = "ERROR: netapp_size_in_tb - value must be between 4 and 500."
condition = var.netapp_size_in_tb != null ? var.netapp_size_in_tb >= 1 && var.netapp_size_in_tb <= 2048 : null
error_message = "ERROR: netapp_size_in_tb - value must be between 1 and 2048."
}
}

Expand Down

0 comments on commit 74be2dd

Please sign in to comment.