aws-asg-fleet 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "aws-asg-fleet"
8
- spec.version = "0.0.2"
8
+ spec.version = "0.0.3"
9
9
  spec.authors = ["Zach Wily"]
10
10
  spec.email = ["zach@zwily.com"]
11
11
  spec.description = %q{AWS Auto Scaling Fleets}
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "aws-sdk", "1.11.3"
21
+ spec.add_dependency "aws-sdk", "~> 1.12"
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.3"
24
24
  spec.add_development_dependency "rake"
@@ -75,6 +75,14 @@ module AWS
75
75
  # '1Minute', this will need to change.)
76
76
  group.enable_metrics_collection(template_group.enabled_metrics.keys)
77
77
 
78
+ # Copy notification configurations
79
+ template_group.notification_configurations.each do |template_nc|
80
+ group.notification_configurations.create(
81
+ :topic => template_nc.topic_arn,
82
+ :types => template_nc.notification_types,
83
+ )
84
+ end
85
+
78
86
  ## Clone the scaling policies and alarms from the group
79
87
  cloudwatch = AWS::CloudWatch.new(:config => config)
80
88
  template_group.scaling_policies.each do |template_policy|
@@ -85,7 +93,15 @@ module AWS
85
93
 
86
94
  template_policy.alarms.keys.each do |template_alarm_name|
87
95
  template_alarm = cloudwatch.alarms[template_alarm_name]
88
- alarm_name = "#{template_alarm.name}-#{group.name}"
96
+
97
+ # try to generate a unique alarm name first by replacing the name
98
+ # of the template group with the new group. if that doesn't work, then
99
+ # just append the new group's name
100
+ alarm_name = template_alarm.name.gsub(template_group.name, group.name)
101
+ if alarm_name == template_group.name
102
+ alarm_name = "#{alarm_name}-#{group.name}"
103
+ end
104
+
89
105
  alarm_options = Fleet.options_from(template_alarm,
90
106
  :namespace, :metric_name, :comparison_operator, :evaluation_periods,
91
107
  :period, :statistic, :threshold, :actions_enabled, :alarm_description,
@@ -120,7 +136,10 @@ module AWS
120
136
  end
121
137
  end
122
138
 
123
- cloudwatch.alarms.create alarm_name, alarm_options
139
+ alarm = cloudwatch.alarms.create alarm_name, alarm_options
140
+ if !template_alarm.enabled?
141
+ alarm.disable
142
+ end
124
143
  end
125
144
  end
126
145
 
@@ -14,13 +14,6 @@ module AWS
14
14
  end
15
15
 
16
16
  class Group
17
- # stupid hack to get an attribute added to Group. It'll be fixed in
18
- # 1.11.4, so remove this and set 1.11.4 as the required version when
19
- # released.
20
- if AWS::VERSION == '1.11.3'
21
- attribute :termination_policies
22
- end
23
-
24
17
  def fleet
25
18
  fleet_tag = tags.find {|t| t[:key] =~ /^asgfleet:/ }
26
19
  return nil unless fleet_tag
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-asg-fleet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-03 00:00:00.000000000 Z
12
+ date: 2013-07-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - '='
19
+ - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 1.11.3
21
+ version: '1.12'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - '='
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 1.11.3
29
+ version: '1.12'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: bundler
32
32
  requirement: !ruby/object:Gem::Requirement