provider/aws: Fix naming in validation of db_instance.final_snapshot_identifier
This commit is contained in:
parent
a76105b0f1
commit
765be4c768
|
@ -155,16 +155,16 @@ func resourceAwsDbInstance() *schema.Resource {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
ValidateFunc: func(v interface{}, k string) (ws []string, es []error) {
|
ValidateFunc: func(v interface{}, k string) (ws []string, es []error) {
|
||||||
fsi := v.(string)
|
value := v.(string)
|
||||||
if !regexp.MustCompile(`^[0-9A-Za-z-]+$`).MatchString(fsi) {
|
if !regexp.MustCompile(`^[0-9A-Za-z-]+$`).MatchString(value) {
|
||||||
es = append(es, fmt.Errorf(
|
es = append(es, fmt.Errorf(
|
||||||
"only alphanumeric characters and hyphens allowed in %s", k))
|
"only alphanumeric characters and hyphens allowed in %q", k))
|
||||||
}
|
}
|
||||||
if regexp.MustCompile(`--`).MatchString(fsi) {
|
if regexp.MustCompile(`--`).MatchString(value) {
|
||||||
es = append(es, fmt.Errorf("%s cannot contain two consecutive hyphens", k))
|
es = append(es, fmt.Errorf("%q cannot contain two consecutive hyphens", k))
|
||||||
}
|
}
|
||||||
if regexp.MustCompile(`-$`).MatchString(fsi) {
|
if regexp.MustCompile(`-$`).MatchString(value) {
|
||||||
es = append(es, fmt.Errorf("%s cannot end in a hyphen", k))
|
es = append(es, fmt.Errorf("%q cannot end in a hyphen", k))
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue