Skip to content

Commit

Permalink
Documentation update to fix issue hashicorp#5871
Browse files Browse the repository at this point in the history
  • Loading branch information
paulomarquesc committed Mar 4, 2021
1 parent 3de9a6f commit 68bf3ae
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 3 deletions.
5 changes: 5 additions & 0 deletions examples/netapp/volume_dual_protocol/README.md
Original file line number Diff line number Diff line change
@@ -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).
57 changes: 57 additions & 0 deletions examples/netapp/volume_dual_protocol/main.tf
Original file line number Diff line number Diff line change
@@ -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
}
}
15 changes: 15 additions & 0 deletions examples/netapp/volume_dual_protocol/variables.tf
Original file line number Diff line number Diff line change
@@ -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"
}
8 changes: 5 additions & 3 deletions website/docs/r/netapp_volume.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
```
Expand All @@ -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.

Expand All @@ -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.

---

Expand Down

0 comments on commit 68bf3ae

Please sign in to comment.