azurerm_netapp_volume_quota_rule

Manages a Volume Quota Rule.

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_virtual_network" "example" {
  name                = "example-virtualnetwork"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  address_space       = ["10.0.0.0/16"]
}

resource "azurerm_subnet" "example" {
  name                 = "example-subnet"
  resource_group_name  = azurerm_resource_group.example.name
  virtual_network_name = azurerm_virtual_network.example.name
  address_prefixes     = ["10.0.2.0/24"]

  delegation {
    name = "netapp"

    service_delegation {
      name    = "Microsoft.Netapp/volumes"
      actions = ["Microsoft.Network/networkinterfaces/*", "Microsoft.Network/virtualNetworks/subnets/join/action"]
    }
  }
}

resource "azurerm_netapp_account" "example" {
  name                = "example-netappaccount"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_netapp_pool" "example" {
  name                = "example-netapppool"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  account_name        = azurerm_netapp_account.example.name
  service_level       = "Premium"
  size_in_tb          = 4
}

resource "azurerm_netapp_volume" "example" {
  lifecycle {
    prevent_destroy = true
  }

  name                       = "example-netappvolume"
  location                   = azurerm_resource_group.example.location
  zone                       = "1"
  resource_group_name        = azurerm_resource_group.example.name
  account_name               = azurerm_netapp_account.example.name
  pool_name                  = azurerm_netapp_pool.example.name
  volume_path                = "my-unique-file-path"
  service_level              = "Premium"
  subnet_id                  = azurerm_subnet.example.id
  network_features           = "Basic"
  protocols                  = ["NFSv4.1"]
  security_style             = "unix"
  storage_quota_in_gb        = 100
  snapshot_directory_visible = false
}

resource "azurerm_netapp_volume_quota_rule" "quota1" {
  name              = "example-quota-rule-1"
  location          = azurerm_resource_group.example.location
  volume_id         = azurerm_netapp_volume.example.id
  quota_target      = "3001"
  quota_size_in_kib = 1024
  quota_type        = "IndividualGroupQuota"
}

resource "azurerm_netapp_volume_quota_rule" "quota2" {
  name              = "example-quota-rule-2"
  location          = azurerm_resource_group.example.location
  volume_id         = azurerm_netapp_volume.example.id
  quota_target      = "2001"
  quota_size_in_kib = 1024
  quota_type        = "IndividualUserQuota"
}

resource "azurerm_netapp_volume_quota_rule" "quota3" {
  name              = "example-quota-rule-3"
  location          = azurerm_resource_group.example.location
  volume_id         = azurerm_netapp_volume.example.id
  quota_size_in_kib = 1024
  quota_type        = "DefaultUserQuota"
}

resource "azurerm_netapp_volume_quota_rule" "quota4" {
  name              = "example-quota-rule-4"
  location          = azurerm_resource_group.example.location
  volume_id         = azurerm_netapp_volume.example.id
  quota_size_in_kib = 1024
  quota_type        = "DefaultGroupQuota"
}

Arguments Reference

The following arguments are supported:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Volume Quota Rules can be imported using the resource id, e.g.

terraform import azurerm_netapp_volume_quota_rule.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/vol1/volumeQuotaRules/quota1