Skip to content

Commit 52733e2

Browse files
Enable underscores in azure resource groups
1 parent 3469c8a commit 52733e2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pkg/provider/azure.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ var azureSurvey = []*survey.Question{
7777
{
7878
Name: "resource",
7979
Prompt: &survey.Input{Message: "Enter the name of the resource group to use as default: "},
80-
Validate: utils.ValidateAlphaNumeric,
80+
Validate: utils.ValidateAlphaNumExtended,
8181
},
8282
}
8383

pkg/utils/validation.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ var ValidateAlphaNumeric = survey.ComposeValidators(
7171
RegexValidator("[a-z][0-9\\-a-z]+", "Must be an alphanumeric string"),
7272
)
7373

74+
var ValidateAlphaNumExtended = survey.ComposeValidators(
75+
survey.Required,
76+
RegexValidator("[a-zA-Z][0-9\\-_a-zA-Z]+", "Must be an alphanumeric string"),
77+
)
78+
7479
func ValidateDns(val string) error {
7580
return ValidateRegex(val, dnsRegex, "String must be a dns compliant hostname")
7681
}

0 commit comments

Comments
 (0)