MovableInkAWS 1.0.6 → 1.0.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe536c901487ed0196cb22c0c03dc62850aeb11ae503b467cd0be73caeacff04
4
- data.tar.gz: bdc29c62402c6199ffb2ae84064013ef894fca69f5bd91ea517bd78288e7fabb
3
+ metadata.gz: 2438d9c7704e6bdb02bd960dc975fa1cbffe715f1c0e104ed7e082bc56e22899
4
+ data.tar.gz: f1df4d7d7420d40f6b6b4250b9064e12430c5a11974eac727e57ce4ba84d077b
5
5
  SHA512:
6
- metadata.gz: ccde77e086f1787390314059aa32b11836cefd854518481afbd09ce198da9258c60eb0ed91e075b87fc70bac1fcd9ecb77b0d649c1c1bf90ec9f108becabd9bc
7
- data.tar.gz: 682c1979026eb42cdfaa570be510c855412797d1e0ff41e20f644a6486cb27d96488dc34f1c465dd02de0d815f33f4ccd35ef42bf4289b797f182116cb68ab4a
6
+ metadata.gz: 8c125dca2b9e941bfca2b3f3e8ed259313edcef38ce7c3eb7053007414938ceb994a83ab0f6e9226217f32fc12b744b20d550552be55e6234e45f0851990f0e9
7
+ data.tar.gz: 7229e62a69815f33100e576983da720f51272ccf2faba390826b2577dd35c443f111e2c7f5e2eab78c40c1e5cf95e3f456ebb66bf845caf3c868805a055ef6ff
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- MovableInkAWS (1.0.6)
4
+ MovableInkAWS (1.0.7)
5
5
  aws-sdk-athena (~> 1)
6
6
  aws-sdk-autoscaling (~> 1)
7
7
  aws-sdk-core (~> 3)
@@ -18,16 +18,16 @@ GEM
18
18
  remote: https://rubygems.org/
19
19
  specs:
20
20
  aws-eventstream (1.0.3)
21
- aws-partitions (1.238.0)
21
+ aws-partitions (1.240.0)
22
22
  aws-sdk-athena (1.21.0)
23
23
  aws-sdk-core (~> 3, >= 3.71.0)
24
24
  aws-sigv4 (~> 1.1)
25
25
  aws-sdk-autoscaling (1.29.0)
26
26
  aws-sdk-core (~> 3, >= 3.71.0)
27
27
  aws-sigv4 (~> 1.1)
28
- aws-sdk-core (3.76.0)
28
+ aws-sdk-core (3.77.0)
29
29
  aws-eventstream (~> 1.0, >= 1.0.2)
30
- aws-partitions (~> 1, >= 1.228.0)
30
+ aws-partitions (~> 1, >= 1.239.0)
31
31
  aws-sigv4 (~> 1.1)
32
32
  jmespath (~> 1.0)
33
33
  aws-sdk-ec2 (1.115.0)
@@ -42,14 +42,14 @@ GEM
42
42
  aws-sdk-route53 (1.30.0)
43
43
  aws-sdk-core (~> 3, >= 3.71.0)
44
44
  aws-sigv4 (~> 1.1)
45
- aws-sdk-s3 (1.53.0)
46
- aws-sdk-core (~> 3, >= 3.71.0)
45
+ aws-sdk-s3 (1.54.0)
46
+ aws-sdk-core (~> 3, >= 3.77.0)
47
47
  aws-sdk-kms (~> 1)
48
48
  aws-sigv4 (~> 1.1)
49
49
  aws-sdk-sns (1.20.0)
50
50
  aws-sdk-core (~> 3, >= 3.71.0)
51
51
  aws-sigv4 (~> 1.1)
52
- aws-sdk-ssm (1.59.0)
52
+ aws-sdk-ssm (1.60.0)
53
53
  aws-sdk-core (~> 3, >= 3.71.0)
54
54
  aws-sigv4 (~> 1.1)
55
55
  aws-sigv4 (1.1.0)
@@ -63,19 +63,19 @@ GEM
63
63
  mime-types-data (~> 3.2015)
64
64
  mime-types-data (3.2019.1009)
65
65
  multi_xml (0.6.0)
66
- rspec (3.6.0)
67
- rspec-core (~> 3.6.0)
68
- rspec-expectations (~> 3.6.0)
69
- rspec-mocks (~> 3.6.0)
70
- rspec-core (3.6.0)
71
- rspec-support (~> 3.6.0)
72
- rspec-expectations (3.6.0)
66
+ rspec (3.9.0)
67
+ rspec-core (~> 3.9.0)
68
+ rspec-expectations (~> 3.9.0)
69
+ rspec-mocks (~> 3.9.0)
70
+ rspec-core (3.9.0)
71
+ rspec-support (~> 3.9.0)
72
+ rspec-expectations (3.9.0)
73
73
  diff-lcs (>= 1.2.0, < 2.0)
74
- rspec-support (~> 3.6.0)
75
- rspec-mocks (3.6.0)
74
+ rspec-support (~> 3.9.0)
75
+ rspec-mocks (3.9.0)
76
76
  diff-lcs (>= 1.2.0, < 2.0)
77
- rspec-support (~> 3.6.0)
78
- rspec-support (3.6.0)
77
+ rspec-support (~> 3.9.0)
78
+ rspec-support (3.9.0)
79
79
 
80
80
  PLATFORMS
81
81
  ruby
@@ -65,8 +65,7 @@ module MovableInk
65
65
  end
66
66
  rescue Aws::Errors::ServiceError => e
67
67
  message = "#{e.class}: #{e.message}\nFrom `#{e.backtrace.last.gsub("`","'")}`"
68
- notify_slack(subject: 'Unhandled AWS API Error',
69
- message: message)
68
+ notify_slack(subject: 'Unhandled AWS API Error', message: message)
70
69
  puts message
71
70
  raise MovableInk::AWS::Errors::ServiceError
72
71
  end
@@ -72,22 +72,19 @@ module MovableInk
72
72
 
73
73
  run_with_backoff do
74
74
  sns.publish(topic_arn: sns_pagerduty_topic_arn,
75
- subject: add_subject_info(subject: "Unable to drain NSQ"),
75
+ subject: "Unable to drain NSQ",
76
76
  message: json_message)
77
77
  end
78
78
  end
79
79
 
80
- def add_subject_info(subject:)
80
+ def notify_slack(subject:, message:)
81
81
  instance_link = "<https://#{my_region}.console.aws.amazon.com/ec2/v2/home?region=#{my_region}#Instances:search=#{instance_id};sort=instanceId|#{instance_id}>"
82
82
  required_info = "Instance: #{instance_link}, `#{private_ipv4}`, `#{my_region}`"
83
- "#{subject.slice(0,99)}\n#{required_info}"
84
- end
85
83
 
86
- def notify_slack(subject:, message:)
87
84
  run_with_backoff do
88
85
  sns.publish(topic_arn: sns_slack_topic_arn,
89
- subject: add_subject_info(subject: subject),
90
- message: message)
86
+ subject: subject.slice(0,99),
87
+ message: "#{required_info}\n#{message}")
91
88
  end
92
89
  end
93
90
  end
@@ -1,5 +1,5 @@
1
1
  module MovableInk
2
2
  class AWS
3
- VERSION = '1.0.6'
3
+ VERSION = '1.0.7'
4
4
  end
5
5
  end
@@ -60,8 +60,8 @@ describe MovableInk::AWS::SNS do
60
60
  message = 'Test message'
61
61
  subject = "a"*150
62
62
  instance_link = "https://us-east-1.console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances:search=i-987654321;sort=instanceId"
63
- expected_subject = "#{"a" * 99}\nInstance: <#{instance_link}|i-987654321>, `10.0.0.1`, `us-east-1`"
64
- expect(sns).to receive(:publish).with({:topic_arn=>"slack-aws-alerts", :message=>"Test message", :subject => expected_subject})
63
+ expected_subject = "#{"a" * 99}"
64
+ expect(sns).to receive(:publish).with({:topic_arn=>"slack-aws-alerts", :message=>"Instance: <#{instance_link}|i-987654321>, `10.0.0.1`, `us-east-1`\nTest message", :subject => expected_subject})
65
65
 
66
66
  aws.notify_slack(subject: subject, message: message)
67
67
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MovableInkAWS
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Chesler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-13 00:00:00.000000000 Z
11
+ date: 2019-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core