Skip to content

Commit

Permalink
Merge pull request #3899 from alucillo/alucillo/autoscaling-group-fix…
Browse files Browse the repository at this point in the history
…-enable-metrics

Update Autoscaling Group with enabled_metrics
  • Loading branch information
bflad authored Mar 28, 2018
2 parents 6313f6d + 50a5a75 commit f943940
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 @@ -545,6 +545,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 f943940

Please sign in to comment.