Merge pull request #7489 from TimeIncOSS/f-aws-elb-hc-maxitem

provider/aws: Only allow max. 1 health_check block for ELB
This commit is contained in:
James Nugent 2016-07-05 12:44:31 +01:00 committed by GitHub
commit 62e4319803
1 changed files with 2 additions and 3 deletions

View File

@ -169,6 +169,7 @@ func resourceAwsElb() *schema.Resource {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"healthy_threshold": &schema.Schema{
@ -590,9 +591,7 @@ func resourceAwsElbUpdate(d *schema.ResourceData, meta interface{}) error {
if d.HasChange("health_check") {
hc := d.Get("health_check").([]interface{})
if len(hc) > 1 {
return fmt.Errorf("Only one health check per ELB is supported")
} else if len(hc) > 0 {
if len(hc) > 0 {
check := hc[0].(map[string]interface{})
configureHealthCheckOpts := elb.ConfigureHealthCheckInput{
LoadBalancerName: aws.String(d.Id()),