forked from hashicorp/terraform-provider-azurerm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
redis_enterprise_cluster_location_flash_sku_support.go
45 lines (36 loc) · 1.28 KB
/
redis_enterprise_cluster_location_flash_sku_support.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package validate
import (
"fmt"
"github.com/kevinklinger/terraform-provider-azurerm/v2/helpers/azure"
"github.com/kevinklinger/terraform-provider-azurerm/v2/internal/location"
)
// RedisEnterpriseClusterLocationFlashSkuSupport - validates that the passed location supports the flash sku type or not
func RedisEnterpriseClusterLocationFlashSkuSupport(input string) error {
location := location.Normalize(input)
invalidLocations := invalidRedisEnterpriseClusterFlashLocations()
for _, str := range invalidLocations {
if location == str {
return fmt.Errorf("%q does not support Redis Enterprise Clusters Flash SKU's. Locations which do not currently support Redis Enterprise Clusters Flash SKU's are [%s]", input, azure.QuotedStringSlice(friendlyInvalidRedisEnterpriseClusterFlashLocations()))
}
}
return nil
}
func invalidRedisEnterpriseClusterFlashLocations() []string {
var validFlash []string
for _, v := range friendlyInvalidRedisEnterpriseClusterFlashLocations() {
validFlash = append(validFlash, location.Normalize(v))
}
return validFlash
}
func friendlyInvalidRedisEnterpriseClusterFlashLocations() []string {
return []string{
"Australia Southeast",
"Brazil South",
"Central US",
"Central US EUAP",
"East Asia",
"UK West",
"East US 2 EUAP",
"South India",
}
}