Skip to content

azurermNetappVolume

Manages a NetApp Volume.

NetApp Volume Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermVirtualNetworkExample = new azurerm.virtualNetwork.VirtualNetwork(
  this,
  "example_1",
  {
    address_space: ["10.0.0.0/16"],
    location: azurermResourceGroupExample.location,
    name: "example-virtualnetwork",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualNetworkExample.overrideLogicalId("example");
const azurermNetappAccountExample = new azurerm.netappAccount.NetappAccount(
  this,
  "example_2",
  {
    location: azurermResourceGroupExample.location,
    name: "example-netappaccount",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermNetappAccountExample.overrideLogicalId("example");
const azurermNetappPoolExample = new azurerm.netappPool.NetappPool(
  this,
  "example_3",
  {
    account_name: azurermNetappAccountExample.name,
    location: azurermResourceGroupExample.location,
    name: "example-netapppool",
    resource_group_name: azurermResourceGroupExample.name,
    service_level: "Premium",
    size_in_tb: 4,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermNetappPoolExample.overrideLogicalId("example");
const azurermSubnetExample = new azurerm.subnet.Subnet(this, "example_4", {
  address_prefixes: ["10.0.2.0/24"],
  delegation: [
    {
      name: "netapp",
      service_delegation: [
        {
          actions: [
            "Microsoft.Network/networkinterfaces/*",
            "Microsoft.Network/virtualNetworks/subnets/join/action",
          ],
          name: "Microsoft.Netapp/volumes",
        },
      ],
    },
  ],
  name: "example-subnet",
  resource_group_name: azurermResourceGroupExample.name,
  virtual_network_name: azurermVirtualNetworkExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSubnetExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the NetApp Volume. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the resource group where the NetApp Volume should be created. Changing this forces a new resource to be created.

  • location - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

  • zone - (Optional) Specifies the Availability Zone in which the Volume should be located. Possible values are 1, 2 and 3. Changing this forces a new resource to be created. This feature is currently in preview, for more information on how to enable it, please refer to Manage availability zone volume placement for Azure NetApp Files.

  • accountName - (Required) The name of the NetApp account in which the NetApp Pool should be created. Changing this forces a new resource to be created.

  • volumePath - (Required) A unique file path for the volume. Used when creating mount targets. Changing this forces a new resource to be created.

  • poolName - (Required) The name of the NetApp pool in which the NetApp Volume should be created. Changing this forces a new resource to be created.

  • serviceLevel - (Required) The target performance of the file system. Valid values include premium, standard, or ultra. Changing this forces a new resource to be created.

  • azureVmwareDataStoreEnabled - (Optional) Is the NetApp Volume enabled for Azure VMware Solution (AVS) datastore purpose. Defaults to false. Changing this forces a new resource to be created.

  • protocols - (Optional) The target volume protocol expressed as a list. Supported single value include cifs, nfSv3, or nfSv41. If argument is not defined it will default to nfSv3. Changing this forces a new resource to be created and data will be lost. Dual protocol scenario is supported for CIFS and NFSv3, for more information, please refer to Create a dual-protocol volume for Azure NetApp Files document.

  • securityStyle - (Optional) Volume security style, accepted values are unix or ntfs. If not provided, single-protocol volume is created defaulting to unix if it is nfSv3 or nfSv41 volume, if cifs, it will default to ntfs. In a dual-protocol volume, if not provided, its value will be ntfs. Changing this forces a new resource to be created.

  • subnetId - (Required) The ID of the Subnet the NetApp Volume resides in, which must have the microsoftNetApp/volumes delegation. Changing this forces a new resource to be created.

  • networkFeatures - (Optional) Indicates which network feature to use, accepted values are basic or standard, it defaults to basic if not defined. This is a feature in public preview and for more information about it and how to register, please refer to Configure network features for an Azure NetApp Files volume. Changing this forces a new resource to be created.

  • storageQuotaInGb - (Required) The maximum Storage Quota allowed for a file system in Gigabytes.

  • snapshotDirectoryVisible - (Optional) Specifies whether the .snapshot (NFS clients) or ~snapshot (SMB clients) path of a volume is visible, default value is true.

  • createFromSnapshotResourceId - (Optional) Creates volume from snapshot. Following properties must be the same as the original volume where the snapshot was taken from: protocols, subnetId, location, serviceLevel, resourceGroupName, accountName and poolName. Changing this forces a new resource to be created.

  • dataProtectionReplication - (Optional) A dataProtectionReplication block as defined below. Changing this forces a new resource to be created.

  • dataProtectionSnapshotPolicy - (Optional) A dataProtectionSnapshotPolicy block as defined below.

  • exportPolicyRule - (Optional) One or more exportPolicyRule block defined below.

  • throughputInMibps - (Optional) Throughput of this volume in Mibps.

  • tags - (Optional) A mapping of tags to assign to the resource.

-> Note: It is highly recommended to use the lifecycle property as noted in the example since it will prevent an accidental deletion of the volume if the protocols argument changes to a different protocol type.


An exportPolicyRule block supports the following:

  • ruleIndex - (Required) The index number of the rule.

  • allowedClients - (Required) A list of allowed clients IPv4 addresses.

  • protocolsEnabled - (Optional) A list of allowed protocols. Valid values include cifs, nfSv3, or nfSv41. Only one value is supported at this time. This replaces the previous arguments: cifsEnabled, nfsv3Enabled and nfsv4Enabled.

  • unixReadOnly - (Optional) Is the file system on unix read only?

  • unixReadWrite - (Optional) Is the file system on unix read and write?

  • rootAccessEnabled - (Optional) Is root access permitted to this volume?


A dataProtectionReplication block is used when enabling the Cross-Region Replication (CRR) data protection option by deploying two Azure NetApp Files Volumes, one to be a primary volume and the other one will be the secondary, the secondary will have this block and will reference the primary volume, each volume must be in a supported region pair and it supports the following:

  • endpointType - (Optional) The endpoint type, default value is dst for destination.

  • remoteVolumeLocation - (Required) Location of the primary volume. Changing this forces a new resource to be created.

  • remoteVolumeResourceId - (Required) Resource ID of the primary volume.

  • replicationFrequency - (Required) Replication frequency, supported values are '10minutes', 'hourly', 'daily', values are case sensitive.

A full example of the dataProtectionReplication attribute can be found in the /examples/netapp/volumeCrr directory within the GitHub Repository

\~> NOTE: dataProtectionReplication can be defined only once per secondary volume, adding a second instance of it is not supported.


A dataProtectionSnapshotPolicy block is used when automatic snapshots for a volume based on a specific snapshot policy. It supports the following:

  • snapshotPolicyId - (Required) Resource ID of the snapshot policy to apply to the volume.

A full example of the dataProtectionSnapshotPolicy attribute usage can be found in the /examples/netapp/nfsv3VolumeWithSnapshotPolicy directory within the GitHub Repository

\~> NOTE: dataProtectionSnapshotPolicy block can be used alone or with data_protection_replication in the primary volume only, if enabling it in the secondary, an error will be thrown.


Attributes Reference

The following attributes are exported:

  • id - The ID of the NetApp Volume.

  • mountIpAddresses - A list of IPv4 Addresses which should be used to mount the volume.

Timeouts

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

  • create - (Defaults to 60 minutes) Used when creating the NetApp Volume.
  • update - (Defaults to 60 minutes) Used when updating the NetApp Volume.
  • read - (Defaults to 5 minutes) Used when retrieving the NetApp Volume.
  • delete - (Defaults to 60 minutes) Used when deleting the NetApp Volume.

Import

NetApp Volumes can be imported using the resourceId, e.g.

terraform import azurerm_netapp_volume.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1