Skip to content

Commit

Permalink
Merge pull request #22721 from neil-yechenwei/fixnetappvolume03
Browse files Browse the repository at this point in the history
azurerm_netapp_volume - update the validation of security_style
  • Loading branch information
tombuildsstuff authored Aug 2, 2023
2 parents c330e37 + dc7304d commit b5d3707
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
13 changes: 5 additions & 8 deletions internal/services/netapp/netapp_volume_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,11 @@ func resourceNetAppVolume() *pluginsdk.Resource {
},

"security_style": {
Type: pluginsdk.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
ValidateFunc: validation.StringInSlice([]string{
"Unix", // Using hardcoded values instead of SDK enum since no matter what case is passed,
"Ntfs", // ANF changes casing to Pascal case in the backend. Please refer to https://github.com/Azure/azure-sdk-for-go/issues/14684
}, false),
Type: pluginsdk.TypeString,
Optional: true,
ForceNew: true,
Computed: true,
ValidateFunc: validation.StringInSlice(volumes.PossibleValuesForSecurityStyle(), false),
},

"storage_quota_in_gb": {
Expand Down
4 changes: 2 additions & 2 deletions internal/services/netapp/netapp_volume_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ resource "azurerm_netapp_volume" "test" {
service_level = "Standard"
subnet_id = azurerm_subnet.test.id
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
storage_quota_in_gb = 100
throughput_in_mibps = 1.562
Expand Down Expand Up @@ -433,7 +433,7 @@ resource "azurerm_netapp_volume" "test" {
service_level = "Standard"
subnet_id = azurerm_subnet.test.id
protocols = ["NFSv3"]
security_style = "Unix"
security_style = "unix"
storage_quota_in_gb = 100
throughput_in_mibps = 1.562
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/netapp_volume.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ resource "azurerm_netapp_volume" "example" {
subnet_id = azurerm_subnet.example.id
network_features = "Basic"
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
storage_quota_in_gb = 100
snapshot_directory_visible = false
Expand Down Expand Up @@ -120,7 +120,7 @@ The following arguments are supported:

* `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/azure/azure-netapp-files/create-volumes-dual-protocol) document.

* `security_style` - (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 `NFSv4.1` 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.
* `security_style` - (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 `NFSv4.1` 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.

* `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 Down

0 comments on commit b5d3707

Please sign in to comment.