Skip to content

Commit

Permalink
feat(aws): Adding conditional scaling policy copy method (#1506)
Browse files Browse the repository at this point in the history
  • Loading branch information
robzienert committed Mar 10, 2017
1 parent a2d2c3f commit 5c2e4c7
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -106,7 +106,7 @@ class DefaultScalingPolicyCopier implements ScalingPolicyCopier {
}
actions
}
sourceAlarms.each { alarm ->
sourceAlarms.findAll{ shouldCopySourceAlarm(it) }.each { alarm ->
List<Dimension> newDimensions = Lists.newArrayList(alarm.dimensions)
Dimension asgDimension = newDimensions.find { it.name == DIMENSION_NAME_FOR_ASG }
if (asgDimension) {
Expand Down Expand Up @@ -135,6 +135,10 @@ class DefaultScalingPolicyCopier implements ScalingPolicyCopier {
}
}

protected boolean shouldCopySourceAlarm(MetricAlarm metricAlarm) {
return true
}

@Canonical
static class ScalingPolicyRetriever extends AwsResultsRetriever<ScalingPolicy, DescribePoliciesRequest, DescribePoliciesResult> {
final AmazonAutoScaling autoScaling
Expand Down

0 comments on commit 5c2e4c7

Please sign in to comment.