ruby_aem_aws 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34448f0994323f7e43c692f579291e49bc7b8d6d
|
4
|
+
data.tar.gz: 6ae2d4f79cf7cecb8ce3e3f958c6d1242d931533
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa09b1af950044949917e929bf65db54a81ee86a22afc23d344896c5b93876651f8b500560794ecfcd68cba0bafd30857f1aa1dfc059365e27e89d5122a8ead7
|
7
|
+
data.tar.gz: cb1e8f21104881a61379c9238fe213806b9a6e58925273f3c5f6c5e9aac474b492438963bfd2e947545d74b2143790c3af54aea03eeebc3a767a5947d64f3618
|
@@ -17,9 +17,11 @@ require_relative '../error'
|
|
17
17
|
module RubyAemAws
|
18
18
|
# Add common methods to all Components.
|
19
19
|
module AbstractCloudwatch
|
20
|
+
private
|
21
|
+
|
20
22
|
# @param alarm_name Cloudwatch alarm name
|
21
23
|
# @return Array of a Cloudwatch alarm filter to filter for a specific Cloudwatch alarm
|
22
|
-
|
24
|
+
def filter_for_cloudwatch_alarm(alarm_name)
|
23
25
|
{
|
24
26
|
alarm_names: [alarm_name]
|
25
27
|
}
|
@@ -29,7 +31,7 @@ module RubyAemAws
|
|
29
31
|
# @param log_stream_name Cloudwatch logstream name
|
30
32
|
# @param log_message log message to filter for
|
31
33
|
# @return Array of a Cloudwatch log event filter to filter for a specific Cloudwatch log event
|
32
|
-
|
34
|
+
def filter_for_cloudwatch_log_event(loggroup_name, log_stream_name, log_message)
|
33
35
|
{
|
34
36
|
log_group_name: loggroup_name,
|
35
37
|
log_stream_names: [log_stream_name],
|
@@ -40,7 +42,7 @@ module RubyAemAws
|
|
40
42
|
# @param loggroup_name Cloudwatch loggroup name
|
41
43
|
# @param log_stream_name Cloudwatch logstream name
|
42
44
|
# @return Array of a Cloudwatch log stream filter to filter for a specific Cloudwatch log stream
|
43
|
-
|
45
|
+
def filter_for_cloudwatch_log_stream(log_group_name, log_stream_name)
|
44
46
|
{
|
45
47
|
log_group_name: log_group_name,
|
46
48
|
log_stream_name_prefix: log_stream_name,
|
@@ -51,7 +53,7 @@ module RubyAemAws
|
|
51
53
|
# @param namespace Cloudwatch metric namespace
|
52
54
|
# @param metric_name Cloudwatch metric name
|
53
55
|
# @return Array of a Cloudwatch metric filter to filter for a specific Cloudwatch metric
|
54
|
-
|
56
|
+
def filter_for_cloudwatch_metric(namespace, metric_name)
|
55
57
|
{
|
56
58
|
namespace: namespace,
|
57
59
|
metric_name: metric_name
|
@@ -60,7 +62,7 @@ module RubyAemAws
|
|
60
62
|
|
61
63
|
# @param dimension_values Cloudwatch Dimension value
|
62
64
|
# @return Array of a Cloudwatch dimension filter for the Cloudwatch metric filter
|
63
|
-
|
65
|
+
def dimensions_filter_for_cloudwatch_metric(dimension_values)
|
64
66
|
{
|
65
67
|
dimensions: [
|
66
68
|
dimension_values
|
@@ -71,7 +73,7 @@ module RubyAemAws
|
|
71
73
|
# @param dimensions_name Cloudwatch Dimension name
|
72
74
|
# @param dimension_values Cloudwatch Dimension value
|
73
75
|
# @return Array of a Cloudwatch Dimension value filter for the Cloudwatch dimension filter
|
74
|
-
|
76
|
+
def dimensions_value_filter_for_cloudwatch_metric(dimensions_name, dimensions_value)
|
75
77
|
{
|
76
78
|
name: dimensions_name,
|
77
79
|
value: dimensions_value
|
@@ -26,19 +26,22 @@ module RubyAemAws
|
|
26
26
|
"#{self.class.name.split('::').last}(#{@descriptor.stack_prefix unless @descriptor.nil?})"
|
27
27
|
end
|
28
28
|
|
29
|
-
private
|
29
|
+
private
|
30
|
+
|
31
|
+
def filter_for_descriptor
|
30
32
|
{
|
31
33
|
filters: [
|
32
34
|
{ name: 'tag:StackPrefix', values: [@descriptor.stack_prefix] },
|
33
35
|
{ name: 'tag:Component', values: [@descriptor.ec2.component] },
|
34
|
-
{ name: 'tag:Name', values: [@descriptor.ec2.name] }
|
36
|
+
{ name: 'tag:Name', values: [@descriptor.ec2.name] },
|
37
|
+
{ name: 'instance-state-name', values: ['running'] }
|
35
38
|
]
|
36
39
|
}
|
37
40
|
end
|
38
41
|
|
39
42
|
# @param snapshot_type SnapshotType tag
|
40
43
|
# @return Array of a EC2 filter to filter for a specific Snapshottype
|
41
|
-
|
44
|
+
def filter_for_snapshot(snapshot_type)
|
42
45
|
{
|
43
46
|
filters: [
|
44
47
|
{ name: 'tag:StackPrefix', values: [@descriptor.stack_prefix] },
|
@@ -15,10 +15,12 @@
|
|
15
15
|
module RubyAemAws
|
16
16
|
# Add common methods to StackManager resource
|
17
17
|
module AbstractStackManager
|
18
|
+
private
|
19
|
+
|
18
20
|
# @param dynamodb_tablename AWS DynamoDB table name
|
19
21
|
# @param attribute_value value to scan for
|
20
22
|
# @return Array of a DynamoDB filter to scan for a specific value
|
21
|
-
|
23
|
+
def filter_for_db_scan(dynamodb_tablename, attribute_value)
|
22
24
|
{
|
23
25
|
table_name: dynamodb_tablename,
|
24
26
|
attributes_to_get: ['command_id'],
|
@@ -35,7 +37,7 @@ module RubyAemAws
|
|
35
37
|
# @param dynamodb_tablename AWS DynamoDB table name
|
36
38
|
# @param attkey_attribute_valueribute_value Key value to query for
|
37
39
|
# @return Array of a DynamoDB filter to query for a specific value
|
38
|
-
|
40
|
+
def filter_for_db_query(dynamodb_tablename, key_attribute_value)
|
39
41
|
{
|
40
42
|
table_name: dynamodb_tablename,
|
41
43
|
consistent_read: true,
|
@@ -59,7 +61,7 @@ module RubyAemAws
|
|
59
61
|
# @param stack_prefix Target Stack Prefix name
|
60
62
|
# @param details SNS Message payload
|
61
63
|
# @return Array of a AWS SNS publish filter to query for a specific value
|
62
|
-
|
64
|
+
def message_for_sns_publish(task, stack_prefix, details)
|
63
65
|
"{ \"default\": \"{ 'task': '#{task}', 'stack_prefix': '#{stack_prefix}', 'details': #{details} }\"}"
|
64
66
|
end
|
65
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_aem_aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shine Solutions
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|