Skip to content

Commit

Permalink
enable management of monitoring policies for autoscaling groups
Browse files Browse the repository at this point in the history
  • Loading branch information
dtorgy committed Apr 4, 2018
1 parent 7021ac1 commit 9c60ddf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/autoscaling/models/AutoScalingDiff.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require "common/models/Diff"
require "common/models/TagsDiff"
require "common/models/ListChange"
require "deepsort"
require "util/Colors"

module Cumulus
Expand Down Expand Up @@ -146,15 +147,15 @@ def aws_name
#
# Returns an array of metrics
def metrics_to_disable
@aws.enabled_metrics - @local.enabled_metrics
@aws.enabled_metrics.map { |k| k.metric }.deep_sort - @local.enabled_metrics.deep_sort
end

# Public: Get the metrics to enable, ie. are in local configuration, but not
# AWS.
#
# Returns an array of metrics
def metrics_to_enable
@local.enabled_metrics - @aws.enabled_metrics
@local.enabled_metrics.deep_sort - @aws.enabled_metrics.map { |k| k.metric }.deep_sort
end

# Public: Get the load balancers to remove, ie. are in AWS and not local
Expand Down
3 changes: 2 additions & 1 deletion lib/autoscaling/models/GroupConfig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
require "autoscaling/models/ScheduledActionDiff"
require "autoscaling/models/ScheduledConfig"
require "common/models/UTCTimeSource"
require "deepsort"
require "ec2/EC2"

require "parse-cron"
Expand Down Expand Up @@ -131,7 +132,7 @@ def diff(aws, autoscaling)
if @cooldown != aws.default_cooldown
diffs << AutoScalingDiff.new(AutoScalingChange::COOLDOWN, aws, self)
end
if @enabled_metrics != aws.enabled_metrics
if @enabled_metrics.deep_sort != aws.enabled_metrics.map { |k| k.metric }.deep_sort
diffs << AutoScalingDiff.new(AutoScalingChange::METRICS, aws, self)
end
if @check_type != aws.health_check_type
Expand Down

0 comments on commit 9c60ddf

Please sign in to comment.