diff --git a/internal/services/datashare/validate/share_name.go b/internal/services/datashare/validate/share_name.go index 24794e4a66d0..67085db345e9 100644 --- a/internal/services/datashare/validate/share_name.go +++ b/internal/services/datashare/validate/share_name.go @@ -12,6 +12,6 @@ import ( func ShareName() pluginsdk.SchemaValidateFunc { return validation.StringMatch( - regexp.MustCompile(`^\w{2,90}$`), `DataShare name can only contain alphanumeric characters and _, and must be between 2 and 90 characters long.`, + regexp.MustCompile(`^[\w-]{2,90}$`), `DataShare name can only contain numbers, letters, - and _, and must be between 2 and 90 characters long.`, ) } diff --git a/internal/services/datashare/validate/share_name_test.go b/internal/services/datashare/validate/share_name_test.go index cf2bf3f4b928..49f0d2bde25d 100644 --- a/internal/services/datashare/validate/share_name_test.go +++ b/internal/services/datashare/validate/share_name_test.go @@ -22,12 +22,12 @@ func TestShareName(t *testing.T) { valid: false, }, { - name: "invalid character2", + name: "valid", input: "adgeFG-98", - valid: false, + valid: true, }, { - name: "valid", + name: "valid 2", input: "dfakF88u7_", valid: true, },