From 22b442bed6e0cc81cf2df7695915563e5db3808e Mon Sep 17 00:00:00 2001 From: Dennis Webb Date: Mon, 19 Sep 2016 10:48:35 -0400 Subject: [PATCH] better if testing --- builtin/providers/aws/resource_aws_autoscaling_policy.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/builtin/providers/aws/resource_aws_autoscaling_policy.go b/builtin/providers/aws/resource_aws_autoscaling_policy.go index 490caf603..63ca8341c 100644 --- a/builtin/providers/aws/resource_aws_autoscaling_policy.go +++ b/builtin/providers/aws/resource_aws_autoscaling_policy.go @@ -219,9 +219,7 @@ func getAwsAutoscalingPutScalingPolicyInput(d *schema.ResourceData) (autoscaling } //if policy_type=="SimpleScaling" then scaling_adjustment is required and 0 is allowed - if *params.PolicyType == "SimpleScaling" { - params.ScalingAdjustment = aws.Int64(int64(d.Get("scaling_adjustment").(int))) - } else if v, ok := d.GetOk("scaling_adjustment"); ok { + if v, ok := d.GetOk("scaling_adjustment"); ok || *params.PolicyType == "SimpleScaling" { params.EstimatedInstanceWarmup = aws.Int64(int64(v.(int))) }