Prevent empty string to be used as default health_check_type
This commit is contained in:
parent
06136bd29e
commit
e378ea42b8
|
@ -127,7 +127,6 @@ func resourceAwsAutoscalingGroupCreate(d *schema.ResourceData, meta interface{})
|
||||||
|
|
||||||
var autoScalingGroupOpts autoscaling.CreateAutoScalingGroupType
|
var autoScalingGroupOpts autoscaling.CreateAutoScalingGroupType
|
||||||
autoScalingGroupOpts.AutoScalingGroupName = aws.String(d.Get("name").(string))
|
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.LaunchConfigurationName = aws.String(d.Get("launch_configuration").(string))
|
||||||
autoScalingGroupOpts.MinSize = aws.Integer(d.Get("min_size").(int))
|
autoScalingGroupOpts.MinSize = aws.Integer(d.Get("min_size").(int))
|
||||||
autoScalingGroupOpts.MaxSize = aws.Integer(d.Get("max_size").(int))
|
autoScalingGroupOpts.MaxSize = aws.Integer(d.Get("max_size").(int))
|
||||||
|
@ -138,6 +137,10 @@ func resourceAwsAutoscalingGroupCreate(d *schema.ResourceData, meta interface{})
|
||||||
autoScalingGroupOpts.DefaultCooldown = aws.Integer(v.(int))
|
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 {
|
if v, ok := d.GetOk("desired_capacity"); ok {
|
||||||
autoScalingGroupOpts.DesiredCapacity = aws.Integer(v.(int))
|
autoScalingGroupOpts.DesiredCapacity = aws.Integer(v.(int))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue