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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/aws_cleaner.rb +6 -11
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67474a14055387fa8416c92892bcc73d236d76f0
4
- data.tar.gz: 544af743776d8bc8a68157813a3327926454baeb
3
+ metadata.gz: d3e12b5da2b7a3faf0306e0b1bf6ab5523037fce
4
+ data.tar.gz: f5b9194b693b8a90efdfc064c45a96434e60ff66
5
5
  SHA512:
6
- metadata.gz: 8c0fc65ffcc9377f19a99cfffaa746835abb9d1cd966e0535443c1316fabdc7b6cc04446ee196bfea927d50ab5256ff7f918d10ee7576eea4e50866d6047e51f
7
- data.tar.gz: 87a062ea6578a0a6b8c97d959a9a5d19839954aa5fbbe2daec88f0cd1f78ad30bf42ea1ea6dae5bb4e15ca41991051a1418f94d78ac10e77b25b957d65103689
6
+ metadata.gz: 87e1b163d917511724d63a96c529316c9876fe3d9b7f125a3788aaddd1fe346ea01a1fe3d7b2a1bd76ad2ac65cad2e2f6d76f9e698d263063965b3de8926a99d
7
+ data.tar.gz: 8c649c46e91d6a32c4508781b7b5e27355870f85e6fb8a539ed6e2629b2c2e9828afe8d4b19fb3830562b3535cfec2e0a713547d39a7c0df3eb69717c4151a7a
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Listen for AWS Config EC2 termination events delivered via SQS
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, 2106 Eric Heydrick
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['configurationItem'].nil? &&
63
- message_body['configurationItemDiff'].nil?
62
+ return false if message_body['detail']['instance-id'].nil? &&
63
+ message_body['detail']['state'] != 'terminated'
64
64
 
65
- if message_body['configurationItem']['resourceType'] == 'AWS::EC2::Instance' &&
66
- message_body['configurationItem']['configurationItemStatus'] == 'ResourceDeleted' &&
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.3.1
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-21 00:00:00.000000000 Z
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