provider/aws: Add validation for aws_security_group (name+description)
This commit is contained in:
parent
d82d803690
commit
4525119a57
|
@ -28,6 +28,14 @@ func resourceAwsSecurityGroup() *schema.Resource {
|
|||
Optional: true,
|
||||
Computed: true,
|
||||
ForceNew: true,
|
||||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
|
||||
value := v.(string)
|
||||
if len(value) > 255 {
|
||||
errors = append(errors, fmt.Errorf(
|
||||
"%q cannot be longer than 255 characters", k))
|
||||
}
|
||||
return
|
||||
},
|
||||
},
|
||||
|
||||
"description": &schema.Schema{
|
||||
|
@ -35,6 +43,14 @@ func resourceAwsSecurityGroup() *schema.Resource {
|
|||
Optional: true,
|
||||
ForceNew: true,
|
||||
Default: "Managed by Terraform",
|
||||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
|
||||
value := v.(string)
|
||||
if len(value) > 255 {
|
||||
errors = append(errors, fmt.Errorf(
|
||||
"%q cannot be longer than 255 characters", k))
|
||||
}
|
||||
return
|
||||
},
|
||||
},
|
||||
|
||||
"vpc_id": &schema.Schema{
|
||||
|
|
Loading…
Reference in New Issue