Allowed values in error message
This commit is contained in:
parent
effec42278
commit
de9a1c146c
|
@ -31,10 +31,16 @@ func resourcePagerDutyUser() *schema.Resource {
|
|||
Computed: true,
|
||||
},
|
||||
"role": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Default: "user",
|
||||
ValidateFunc: validateValueFunc([]string{"admin", "limited_user", "owner", "read_only_user", "user"}),
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Default: "user",
|
||||
ValidateFunc: validateValueFunc([]string{
|
||||
"admin",
|
||||
"limited_user",
|
||||
"owner",
|
||||
"read_only_user",
|
||||
"user",
|
||||
}),
|
||||
},
|
||||
"job_title": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
|
|
|
@ -19,7 +19,7 @@ func validateValueFunc(values []string) schema.SchemaValidateFunc {
|
|||
}
|
||||
|
||||
if !valid {
|
||||
errors = append(errors, fmt.Errorf("%s is an invalid value for argument %s", value, k))
|
||||
errors = append(errors, fmt.Errorf("%s is an invalid value for argument %s. Must be one of %v", value, k, values))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue