mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Allowed values in error message
This commit is contained in:
parent
effec42278
commit
de9a1c146c
@ -31,10 +31,16 @@ func resourcePagerDutyUser() *schema.Resource {
|
|||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"role": &schema.Schema{
|
"role": &schema.Schema{
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: "user",
|
Default: "user",
|
||||||
ValidateFunc: validateValueFunc([]string{"admin", "limited_user", "owner", "read_only_user", "user"}),
|
ValidateFunc: validateValueFunc([]string{
|
||||||
|
"admin",
|
||||||
|
"limited_user",
|
||||||
|
"owner",
|
||||||
|
"read_only_user",
|
||||||
|
"user",
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
"job_title": &schema.Schema{
|
"job_title": &schema.Schema{
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
|
@ -19,7 +19,7 @@ func validateValueFunc(values []string) schema.SchemaValidateFunc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !valid {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user