Skip to content

Commit

Permalink
Allow - in disk snapshot names
Browse files Browse the repository at this point in the history
It appears that - was omitted from the possible character in snapshot
names.
It doesn't seem like there is any issue when using - in the name, as
I was able to create snapshots with dashes both from the portal and
through this plugin (with this patch applied).
  • Loading branch information
Bertrand Roussel committed Jul 14, 2018
1 parent ba9e3f5 commit 11d339d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions azurerm/resource_arm_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ func resourceArmSnapshotDelete(d *schema.ResourceData, meta interface{}) error {
}

func validateSnapshotName(v interface{}, k string) (ws []string, errors []error) {
// a-z, A-Z, 0-9 and _. The max name length is 80
// a-z, A-Z, 0-9, _ and -. The max name length is 80
value := v.(string)

r, _ := regexp.Compile("^[A-Za-z0-9_]+$")
r, _ := regexp.Compile("^[A-Za-z0-9_-]+$")
if !r.MatchString(value) {
errors = append(errors, fmt.Errorf("Snapshot Names can only contain alphanumeric characters and underscores."))
}
Expand Down

0 comments on commit 11d339d

Please sign in to comment.