cfn-guardian 0.7.1 → 0.7.2

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: 72248fcb349fb266e18552dd36dcff37b4757574fb91583092dad34037c8be5f
4
- data.tar.gz: f3db4dfb6d7d91e4e39a6832b832d6b2dc75537b0de0a31aaa2ad0837389a4bd
3
+ metadata.gz: 1417ef4853dc20a776837ec1fee0433449dd1f4fd5601081ca2602c8cc6b9f06
4
+ data.tar.gz: 5ff99a91ba3c512dca2cde401b0ce8c1ada0127c9e56928f7fde9ead8c4cc5b6
5
5
  SHA512:
6
- metadata.gz: d8bc7d02245dde79df68affc7bc910b7c9657172b0473bb48e71e03e39cd83d6869e649ec362cc7592c31900bf5338f809001f2efac177c2c0b3a33fe326f333
7
- data.tar.gz: 6b7789eca2cbfeefe60d997de944d004bc481d27db7b8c49bfb016ed0924bff971503d34288caf56d787cc4145426988734b146ec9cdcd7addc8eebf5049fe29
6
+ metadata.gz: b3eed6e24561d7927408b771317a93d1fe421f784fd3b0e3260df790d710c90e1abe1749e856c0cbc3ec0ebe30a4842d40c3714f2943843e19c1f7eac215010d
7
+ data.tar.gz: 3851fe0ad73593f25bd0eff3a62031345b4214d5bff9384c072a11af93192308d548aca7f83525935602b4c794077f24462bccccf547cb8801d2b52cdc1d5de1
data/Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
1
  FROM ruby:2.7-alpine
2
2
 
3
- ARG GUARDIAN_VERSION="0.6.9"
3
+ ARG GUARDIAN_VERSION="0.7.1"
4
4
 
5
5
  COPY . /src
6
6
 
@@ -32,6 +32,8 @@ Resources:
32
32
  Method: post
33
33
  # specify headers using "key=value key=value"
34
34
  Headers: content-type=application/json
35
+ # specify a useragent that contains spaces
36
+ UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Base2/Lambda
35
37
  # pass in custom payload for the request
36
38
  Payload: '{"name": "john"}'
37
39
  ```
@@ -15,10 +15,20 @@ Resources:
15
15
  # Name of the cloud watch metric
16
16
  - MetricName: MyFunctionErrors
17
17
  # search pattern, see aws docs for syntax
18
- Pattern: error
18
+ Pattern: 'error'
19
19
  # metric to push to cloudwatch. Optional as it defaults to 1
20
20
  MetricValue: 1
21
-
21
+ - Id: /prod/custom/app
22
+ # List of metric filters
23
+ MetricFilters:
24
+ # Name of the cloud watch metric
25
+ - MetricName: MyAppErrors
26
+ # search pattern, see aws docs for syntax
27
+ # note; any non-alphanumeric characters have to be wrapped in double quotes WITHIN single quotes
28
+ Pattern: '"Connection to ssl://mail.google.com:465 Timed Out"'
29
+ # metric to push to cloudwatch. Optional as it defaults to 1
30
+ MetricValue: 1
31
+
22
32
  Templates:
23
33
  LogGroup:
24
34
  # use the MetricName name to override the alarm defaults
@@ -40,7 +40,7 @@ module CfnGuardian
40
40
  @name = 'HttpCheck'
41
41
  @package = 'http-check'
42
42
  @handler = 'handler.http_check'
43
- @version = 'dba2670c753d0d3386937fbcc1fc89499a4a0fa7'
43
+ @version = '0e945240f9d93242f807e86d1a9b3383a1764b96'
44
44
  @runtime = 'python3.7'
45
45
  end
46
46
  end
@@ -52,6 +52,7 @@ module CfnGuardian
52
52
  @status_code = resource.fetch('StatusCode',200)
53
53
  @body_regex = resource.fetch('BodyRegex',nil)
54
54
  @headers = resource.fetch('Headers',nil)
55
+ @user_agent = resource.fetch('UserAgent',nil)
55
56
  @payload = resource.fetch('Payload',nil)
56
57
  @compressed = resource.fetch('Compressed',false)
57
58
  end
@@ -65,6 +66,7 @@ module CfnGuardian
65
66
  }
66
67
  payload['BODY_REGEX_MATCH'] = @body_regex unless @body_regex.nil?
67
68
  payload['HEADERS'] = @headers unless @headers.nil?
69
+ payload['USER_AGENT'] = @user_agent unless @user_agent.nil?
68
70
  payload['PAYLOAD'] = @payload unless @payload.nil?
69
71
  payload['COMPRESSED'] = '1' if @compressed
70
72
  return payload.to_json
@@ -24,6 +24,7 @@ module CfnGuardian::Resource
24
24
  alarm.name = 'IteratorAge'
25
25
  alarm.metric_name = 'IteratorAge'
26
26
  alarm.threshold = 600000
27
+ alarm.treat_missing_data = 'notBreaching'
27
28
  @alarms.push(alarm)
28
29
 
29
30
  alarm = CfnGuardian::Models::LambdaAlarm.new(@resource)
@@ -31,6 +32,7 @@ module CfnGuardian::Resource
31
32
  alarm.metric_name = 'Duration'
32
33
  alarm.statistic = 'Average'
33
34
  alarm.threshold = 30
35
+ alarm.treat_missing_data = 'notBreaching'
34
36
  @alarms.push(alarm)
35
37
  end
36
38
 
@@ -1,4 +1,4 @@
1
1
  module CfnGuardian
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  CHANGE_SET_VERSION = VERSION.gsub('.', '-').freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfn-guardian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guslington
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-07 00:00:00.000000000 Z
11
+ date: 2021-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor