aws-cleaner 0.3.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/aws_cleaner.rb +6 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3e12b5da2b7a3faf0306e0b1bf6ab5523037fce
|
4
|
+
data.tar.gz: f5b9194b693b8a90efdfc064c45a96434e60ff66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87e1b163d917511724d63a96c529316c9876fe3d9b7f125a3788aaddd1fe346ea01a1fe3d7b2a1bd76ad2ac65cad2e2f6d76f9e698d263063965b3de8926a99d
|
7
|
+
data.tar.gz: 8c649c46e91d6a32c4508781b7b5e27355870f85e6fb8a539ed6e2629b2c2e9828afe8d4b19fb3830562b3535cfec2e0a713547d39a7c0df3eb69717c4151a7a
|
data/bin/aws_cleaner.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
#
|
3
|
-
# Listen for AWS
|
3
|
+
# Listen for AWS CloudWatch Events EC2 termination events delivered via SQS
|
4
4
|
# and remove the node from Chef and Sensu and send a notification
|
5
5
|
# to Hipchat
|
6
6
|
#
|
7
|
-
# Copyright (c) 2015,
|
7
|
+
# Copyright (c) 2015, 2016 Eric Heydrick
|
8
8
|
# Licensed under The MIT License
|
9
9
|
#
|
10
10
|
|
@@ -59,16 +59,11 @@ end
|
|
59
59
|
|
60
60
|
# return the instance_id of the terminated instance
|
61
61
|
def process_message(message_body)
|
62
|
-
return false if message_body['
|
63
|
-
message_body['
|
62
|
+
return false if message_body['detail']['instance-id'].nil? &&
|
63
|
+
message_body['detail']['state'] != 'terminated'
|
64
64
|
|
65
|
-
|
66
|
-
|
67
|
-
message_body['configurationItemDiff']['changeType'] == 'DELETE'
|
68
|
-
instance_id = message_body['configurationItem']['resourceId']
|
69
|
-
end
|
70
|
-
|
71
|
-
instance_id ? instance_id : false
|
65
|
+
instance_id = message_body['detail']['instance-id']
|
66
|
+
instance_id
|
72
67
|
end
|
73
68
|
|
74
69
|
# call the Chef API to get the node name of the instance
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-cleaner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Heydrick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|