Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_netapp_volume - update the validation of security_style #22721

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -355,7 +355,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 @@ -432,7 +432,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