diff --git a/examples/netapp/volume_dual_protocol/README.md b/examples/netapp/volume_dual_protocol/README.md new file mode 100644 index 000000000000..b9dc487f2a95 --- /dev/null +++ b/examples/netapp/volume_dual_protocol/README.md @@ -0,0 +1,5 @@ +## Example: NetApp Files Volume Dual-Protocol (CIFS+NFSv3) enabled + +This example shows how to create an Azure NetApp Files Volume with dual protocol, CIFS and NFSv3. + +For more information, please refer to [Create a dual-protocol (NFSv3 and SMB) volume for Azure NetApp Files](https://docs.microsoft.com/en-us/azure/azure-netapp-files/create-volumes-dual-protocol). \ No newline at end of file diff --git a/examples/netapp/volume_dual_protocol/main.tf b/examples/netapp/volume_dual_protocol/main.tf new file mode 100644 index 000000000000..1653a0388302 --- /dev/null +++ b/examples/netapp/volume_dual_protocol/main.tf @@ -0,0 +1,57 @@ +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "example" { + name = "${var.prefix}-resources" + location = var.location +} + +resource "azurerm_netapp_account" "example" { + name = "${var.prefix}-netappaccount" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + + active_directory { + username = "pmcadmin" + password = var.password + smb_server_name = "SMBSERVER" + dns_servers = ["10.2.0.4"] + domain = "anf.local" + } +} + +resource "azurerm_netapp_pool" "example" { + name = "${var.prefix}-netapppool" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + account_name = azurerm_netapp_account.example.name + service_level = "Standard" + size_in_tb = 4 +} + +resource "azurerm_netapp_volume" "example" { + lifecycle { + prevent_destroy = true + } + + name = "${var.prefix}-netappvolume" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + account_name = azurerm_netapp_account.example.name + pool_name = azurerm_netapp_pool.example.name + volume_path = "${var.prefix}-netappvolume" + service_level = "Standard" + protocols = ["CIFS","NFSv3"] + subnet_id = var.subnet_id + storage_quota_in_gb = 100 + + export_policy_rule { + rule_index = 1 + allowed_clients = ["0.0.0.0/0"] + cifs_enabled = true + nfsv3_enabled = true + nfsv4_enabled = false + unix_read_write = true + } +} diff --git a/examples/netapp/volume_dual_protocol/variables.tf b/examples/netapp/volume_dual_protocol/variables.tf new file mode 100644 index 000000000000..a3c6f11db6b5 --- /dev/null +++ b/examples/netapp/volume_dual_protocol/variables.tf @@ -0,0 +1,15 @@ +variable "location" { + description = "The Azure location where all resources in this example should be created." +} + +variable "prefix" { + description = "The prefix used for all resources used by this NetApp Volume" +} + +variable "password" { + description = "User Password to create ActiveDirectory object" +} + +variable "subnet_id" { + description = "Subnet id (delegated to Microsoft.Netapp/volumes) to attach the volume to" +} diff --git a/website/docs/r/netapp_volume.html.markdown b/website/docs/r/netapp_volume.html.markdown index 692d63557172..8389836d9316 100644 --- a/website/docs/r/netapp_volume.html.markdown +++ b/website/docs/r/netapp_volume.html.markdown @@ -78,7 +78,7 @@ resource "azurerm_netapp_volume" "example" { endpoint_type = "dst" remote_volume_location = azurerm_resource_group.example_primary.location remote_volume_resource_id = azurerm_netapp_volume.example_primary.id - replication_frequency = "_10minutely" + replication_frequency = "10minutes" } } ``` @@ -101,7 +101,7 @@ The following arguments are supported: * `service_level` - (Required) The target performance of the file system. Valid values include `Premium`, `Standard`, or `Ultra`. -* `protocols` - (Optional) The target volume protocol expressed as a list. Supported single value include `CIFS`, `NFSv3`, or `NFSv4.1`. If argument is not defined it will default to `NFSv3`. Changing this forces a new resource to be created and data will be lost. +* `protocols` - (Optional) The target volume protocol expressed as a list. Supported single value include `CIFS`, `NFSv3`, or `NFSv4.1`. 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](https://docs.microsoft.com/en-us/azure/azure-netapp-files/create-volumes-dual-protocol) document. * `subnet_id` - (Required) The ID of the Subnet the NetApp Volume resides in, which must have the `Microsoft.NetApp/volumes` delegation. Changing this forces a new resource to be created. @@ -111,7 +111,9 @@ The following arguments are supported: * `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 example on how to create a dual protocol volume can be found at [`./examples/netapp/volume_dual_protocol` directory within the Github Repository](https://github.com/terraform-providers/terraform-provider-azurerm/tree/master/examples/netapp/volume_dual_protocol) + +-> **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. ---