add validation for cookie stickiness

This commit is contained in:
clint shryock 2015-11-13 10:46:27 -06:00
parent b81f9a9c52
commit e94fcdb9df
1 changed files with 8 additions and 0 deletions

View File

@ -42,6 +42,14 @@ func resourceAwsLBCookieStickinessPolicy() *schema.Resource {
Type: schema.TypeInt,
Optional: true,
ForceNew: true,
ValidateFunc: func(v interface{}, k string) (ws []string, es []error) {
value := v.(int)
if value <= 0 {
es = append(es, fmt.Errorf(
"LB Cookie Expiration Period must be greater than zero if specified"))
}
return
},
},
},
}