Skip to content

Commit

Permalink
Fixed bug where the update step did not detect changes to the enabled…
Browse files Browse the repository at this point in the history
…_metrics list if it was empty.
  • Loading branch information
Anthony Lucillo committed Mar 27, 2018
1 parent 301c19c commit 50a5a75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aws/resource_aws_autoscaling_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,8 @@ func resourceAwsAutoscalingGroupRead(d *schema.ResourceData, meta interface{}) e
log.Printf("[WARN] Error setting metrics for (%s): %s", d.Id(), err)
}
d.Set("metrics_granularity", g.EnabledMetrics[0].Granularity)
} else {
d.Set("enabled_metrics", nil)
}

return nil
Expand Down
2 changes: 2 additions & 0 deletions aws/resource_aws_autoscaling_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ func TestAccAWSAutoScalingGroup_basic(t *testing.T) {
"aws_autoscaling_group.bar", "termination_policies.1", "ClosestToNextInstanceHour"),
resource.TestCheckResourceAttr(
"aws_autoscaling_group.bar", "protect_from_scale_in", "false"),
resource.TestCheckResourceAttr(
"aws_autoscaling_group.bar", "enabled_metrics.#", "0"),
),
},

Expand Down

0 comments on commit 50a5a75

Please sign in to comment.