Skip to content

Commit

Permalink
Merge pull request #1052 from TimeInc/hct-bugfix
Browse files Browse the repository at this point in the history
Bug: Prevent empty string to be used as default health_check_type
  • Loading branch information
pearkes committed Feb 27, 2015
2 parents 1f7e71b + e378ea4 commit 053a7c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion builtin/providers/aws/resource_aws_autoscaling_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ func resourceAwsAutoscalingGroupCreate(d *schema.ResourceData, meta interface{})

var autoScalingGroupOpts autoscaling.CreateAutoScalingGroupType
autoScalingGroupOpts.AutoScalingGroupName = aws.String(d.Get("name").(string))
autoScalingGroupOpts.HealthCheckType = aws.String(d.Get("health_check_type").(string))
autoScalingGroupOpts.LaunchConfigurationName = aws.String(d.Get("launch_configuration").(string))
autoScalingGroupOpts.MinSize = aws.Integer(d.Get("min_size").(int))
autoScalingGroupOpts.MaxSize = aws.Integer(d.Get("max_size").(int))
Expand All @@ -138,6 +137,10 @@ func resourceAwsAutoscalingGroupCreate(d *schema.ResourceData, meta interface{})
autoScalingGroupOpts.DefaultCooldown = aws.Integer(v.(int))
}

if v, ok := d.GetOk("health_check"); ok && v.(string) != "" {
autoScalingGroupOpts.HealthCheckType = aws.String(v.(string))
}

if v, ok := d.GetOk("desired_capacity"); ok {
autoScalingGroupOpts.DesiredCapacity = aws.Integer(v.(int))
}
Expand Down

0 comments on commit 053a7c0

Please sign in to comment.