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_group_sap_hana - update the validation of security_style #22615

Merged
merged 10 commits into from
Jul 28, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (r NetAppVolumeGroupSapHanaResource) Arguments() map[string]*pluginsdk.Sche
Type: pluginsdk.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice(netAppValidate.PossibleValuesForSecurityStyle(), false),
ValidateFunc: validation.StringInSlice(volumegroups.PossibleValuesForSecurityStyle(), false),
},

"storage_quota_in_gb": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -201,7 +201,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -231,7 +231,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -260,7 +260,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -289,7 +289,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -340,7 +340,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -370,7 +370,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -400,7 +400,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -429,7 +429,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv3"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -458,7 +458,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv3"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -529,7 +529,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -563,7 +563,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -597,7 +597,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -630,7 +630,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -663,7 +663,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -738,7 +738,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -772,7 +772,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -806,7 +806,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -839,7 +839,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -872,7 +872,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -927,7 +927,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1200
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -957,7 +957,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -987,7 +987,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -1016,7 +1016,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -1045,7 +1045,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test" {
storage_quota_in_gb = 1200
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -1096,7 +1096,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_primary" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -1126,7 +1126,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_primary" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -1156,7 +1156,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_primary" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -1185,7 +1185,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_primary" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -1214,7 +1214,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_primary" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -1258,7 +1258,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -1295,7 +1295,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -1325,7 +1325,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -1361,7 +1361,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -1397,7 +1397,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" {
storage_quota_in_gb = 1024
throughput_in_mibps = 24
protocols = ["NFSv4.1"]
security_style = "Unix"
security_style = "unix"
snapshot_directory_visible = false

export_policy_rule {
Expand Down Expand Up @@ -1431,7 +1431,7 @@ resource "azurerm_netapp_volume_group_sap_hana" "test_secondary" {
}


`, template, data.RandomInteger, "eastus")
`, template, data.RandomInteger, "westus")
}

func (r NetAppVolumeGroupSapHanaResource) templateForAvgCrossRegionReplication(data acceptance.TestData) string {
Expand Down Expand Up @@ -1595,7 +1595,7 @@ resource "azurerm_netapp_pool" "test_secondary" {
"SkipASMAzSecPack" = "true"
}
}
`, template, data.RandomInteger, "eastus")
`, template, data.RandomInteger, "westus")
}

func (NetAppVolumeGroupSapHanaResource) templatePPG(data acceptance.TestData) string {
Expand Down Expand Up @@ -1781,5 +1781,5 @@ resource "azurerm_netapp_pool" "test" {
"SkipASMAzSecPack" = "true"
}
}
`, data.RandomInteger, "westus")
`, data.RandomInteger, "eastus")
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,6 @@ func PossibleValuesForProtocolTypeVolumeGroupSapHana() []string {
}
}

// Diverging from the SDK volumegroups.SecurityStyle since it is defined as lower case
// but the backend changes it to Pascal case on GET. Please refer to https://github.com/Azure/azure-sdk-for-go/issues/14684
type SecurityStyle string

const (
SecurityStyleUnix SecurityStyle = "Unix"
SecurityStyleNtfs SecurityStyle = "Ntfs"
)

func PossibleValuesForSecurityStyle() []string {
return []string{
string(SecurityStyleUnix),
}
}

func ValidateNetAppVolumeGroupSAPHanaVolumes(volumeList *[]volumegroups.VolumeGroupVolumeProperties) []error {
errors := make([]error, 0)
volumeSpecRepeatCount := make(map[string]int)
Expand Down
Loading