support volumes created before name rules changed (#404)
* support volumes created before name rules changed In 2019, DigitalOcean accepted volumes created with underscores in the name. In 2020, this is no longer the case but it leaves us without a way to work with volumes created in the old rules. * Add comment on why regexp does not match message. Co-authored-by: Andrew Starr-Bochicchio <a.starr.b@gmail.com>
This commit is contained in:
parent
12af297769
commit
d5a228360e
|
@ -34,10 +34,12 @@ func resourceDigitalOceanVolume() *schema.Resource {
|
|||
},
|
||||
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-z0-9\-]+$`), "Names must be lowercase and be composed only of numbers, letters and \"-\"."),
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
// Underscores (_) allowed for backwards compatibility.
|
||||
// See: https://github.com/terraform-providers/terraform-provider-digitalocean/pull/404
|
||||
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-z0-9\-_]+$`), "Names must be lowercase and be composed only of numbers, letters and \"-\"."),
|
||||
},
|
||||
"urn": {
|
||||
Type: schema.TypeString,
|
||||
|
|
Loading…
Reference in New Issue