ruby_aem_aws 1.4.0 → 1.5.0

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
  SHA1:
3
- metadata.gz: 143bcd08d3dcf1d4bf7955a43031c7734b5048c9
4
- data.tar.gz: 7b61a8d54896d4021158fd9ce0dce4c50bb05264
3
+ metadata.gz: ae2d23eb45fce95d159684a8b556feb24c638046
4
+ data.tar.gz: c127bec2c5002dcb157577c9f70ae16a6ace5d1c
5
5
  SHA512:
6
- metadata.gz: 2a3c723d12b9cbb095f175b8503300e997ff980374355170fb51acb6d10101c298f271577f6ed4847954c4fe2b326ac3f61f9582e73d33c42ed1a288dcfabe70
7
- data.tar.gz: 4d25ad2d48f49ad2cc1d87f2492f2d112d7c5625f385210eb770524f1a9130df0e20eb3331c914469a69fd5220e49374c6cf5af8d00a85c2afdfbda17fbe8f94
6
+ metadata.gz: 0cfee40d46a45d145c413ceab6811188210a6a1495bb277aa596d0497fd099f5440c4aebddbd461dc5fd2bab100d9ecd778726192beca13fd47f89332e4b7232
7
+ data.tar.gz: eaaadb2ebfd4f17e720cc4ad9578fc30b8247d8d2f95e44cb44d40f8524a8c5c3b744e2cc90a9a6d7b434ba46a8e029c197527ae3c1f2a0beda4b39f37a37431
@@ -1 +1 @@
1
- version: 1.4.0
1
+ version: 1.5.0
@@ -20,18 +20,18 @@ module RubyAemAws
20
20
  # AemAws class represents the AWS stack for AEM.
21
21
  class AemAws
22
22
  # @param conf configuration hash of the following configuration values:
23
- # - region: the AWS region (eg ap-southeast-2)
23
+ # - aws_region: the AWS region (eg ap-southeast-2)
24
24
  # - aws_access_key_id: the AWS access key
25
25
  # - aws_secret_access_key: the AWS secret access key
26
26
  # - aws_profile: AWS profile name
27
27
  # @return new RubyAemAws::AemAws instance
28
28
  def initialize(conf = {})
29
- conf[:region] ||= Constants::REGION_DEFAULT
29
+ conf[:aws_region] ||= Constants::REGION_DEFAULT
30
30
  conf[:aws_access_key_id] ||= Constants::ACCESS_KEY_ID
31
31
  conf[:aws_secret_access_key] ||= Constants::SECRET_ACCESS_KEY
32
32
  conf[:aws_profile] ||= Constants::PROFILE
33
33
 
34
- Aws.config.update(region: conf[:region])
34
+ Aws.config.update(region: conf[:aws_region])
35
35
 
36
36
  credentials = Aws::Credentials.new(conf[:aws_access_key_id], conf[:aws_secret_access_key]) unless conf[:aws_access_key_id].nil?
37
37
  credentials = Aws::SharedCredentials.new(profile_name: conf[:aws_profile]) unless conf[:aws_profile].nil?
@@ -58,11 +58,6 @@ module RubyAemAws
58
58
  # Create a consolidated instance.
59
59
  #
60
60
  # @param stack_prefix AWS tag: StackPrefix
61
- # @param aws_clients Array of AWS Clients and Resource connections:
62
- # - CloudFormationClient: AWS Cloudformation Client.
63
- # - CloudWatchClient: AWS Cloudwatch Client.
64
- # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
65
- # - Ec2Resource: AWS EC2 Resource connection.
66
61
  # @return new RubyAemAws::ConsolidatedStack instance
67
62
  def consolidated(stack_prefix)
68
63
  aws_clients = {
@@ -78,13 +73,6 @@ module RubyAemAws
78
73
  # Create a full set instance.
79
74
  #
80
75
  # @param stack_prefix AWS tag: StackPrefix
81
- # @param aws_clients Array of AWS Clients and Resource connections:
82
- # - AutoScalingClient: AWS AutoScalingGroup Client.
83
- # - CloudFormationClient: AWS Cloudformation Client.
84
- # - CloudWatchClient: AWS Cloudwatch Client.
85
- # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
86
- # - Ec2Resource: AWS EC2 Resource connection.
87
- # - ElbClient: AWS ElasticLoadBalancer Client.
88
76
  # @return new RubyAemAws::FullSetStack instance
89
77
  def full_set(stack_prefix)
90
78
  aws_clients = {
@@ -102,13 +90,6 @@ module RubyAemAws
102
90
  # Create Stack Manager resources
103
91
  #
104
92
  # @param stack_prefix AWS tag: StackPrefix
105
- # @param aws_clients Array of AWS Clients and Resource connections:
106
- # - CloudFormationClient: AWS Cloudformation Client.
107
- # - CloudWatchClient: AWS Cloudwatch Client.
108
- # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
109
- # - DynamoDBClient: AWS DynamoDB Client.
110
- # - S3Client: AWS S3 Client.
111
- # - S3Resource: AWS S3 Resource connection.
112
93
  # @return new RubyAemAws::StackManager instance
113
94
  def stack_manager(stack_prefix)
114
95
  aws_clients = {
@@ -39,7 +39,7 @@ module RubyAemAws
39
39
  }
40
40
  end
41
41
 
42
- # @param loggroup_name Cloudwatch loggroup name
42
+ # @param log_group_name Cloudwatch loggroup name
43
43
  # @param log_stream_name Cloudwatch logstream name
44
44
  # @return Array of a Cloudwatch log stream filter to filter for a specific Cloudwatch log stream
45
45
  def filter_for_cloudwatch_log_stream(log_group_name, log_stream_name)
@@ -71,7 +71,7 @@ module RubyAemAws
71
71
  end
72
72
 
73
73
  # @param dimensions_name Cloudwatch Dimension name
74
- # @param dimension_values Cloudwatch Dimension value
74
+ # @param dimensions_value Cloudwatch Dimension value
75
75
  # @return Array of a Cloudwatch Dimension value filter for the Cloudwatch dimension filter
76
76
  def dimensions_value_filter_for_cloudwatch_metric(dimensions_name, dimensions_value)
77
77
  {
@@ -33,7 +33,6 @@ module RubyAemAws
33
33
  filters: [
34
34
  { name: 'tag:StackPrefix', values: [@descriptor.stack_prefix] },
35
35
  { name: 'tag:Component', values: [@descriptor.ec2.component] },
36
- { name: 'tag:Name', values: [@descriptor.ec2.name] },
37
36
  { name: 'instance-state-name', values: ['running'] }
38
37
  ]
39
38
  }
@@ -35,7 +35,7 @@ module RubyAemAws
35
35
  end
36
36
 
37
37
  # @param dynamodb_tablename AWS DynamoDB table name
38
- # @param attkey_attribute_valueribute_value Key value to query for
38
+ # @param key_attribute_value Key value to query for
39
39
  # @return Array of a DynamoDB filter to query for a specific value
40
40
  def filter_for_db_query(dynamodb_tablename, key_attribute_value)
41
41
  {
@@ -36,11 +36,6 @@ module RubyAemAws
36
36
  @stack_prefix = stack_prefix
37
37
  end
38
38
 
39
- # @param stack_prefix AWS tag: StackPrefix
40
- # @param consolidated_aws_clients Array of AWS Clients and Resource connections:
41
- # - CloudWatchClient: AWS Cloudwatch Client.
42
- # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
43
- # - Ec2Resource: AWS EC2 Resource connection.
44
39
  # @return new RubyAemAws::Component::AuthorPublishDispatcher instance
45
40
  def author_publish_dispatcher
46
41
  RubyAemAws::Component::AuthorPublishDispatcher.new(@stack_prefix, @consolidated_aws_clients)
@@ -70,69 +70,31 @@ module RubyAemAws
70
70
  @stack_prefix = stack_prefix
71
71
  end
72
72
 
73
- # @param stack_prefix AWS tag: StackPrefix
74
- # @param dispatcher_aws_clients Array of AWS Clients and Resource connections:
75
- # - AutoScalingClient: AWS AutoScalingGroup Client.
76
- # - CloudWatchClient: AWS Cloudwatch Client.
77
- # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
78
- # - Ec2Resource: AWS EC2 Resource connection.
79
- # - ElbClient: AWS ElasticLoadBalancer Client.
80
73
  # @return new RubyAemAws::Component::AuthorDispatcher instance
81
74
  def author_dispatcher
82
75
  RubyAemAws::Component::AuthorDispatcher.new(@stack_prefix, @dispatcher_aws_clients)
83
76
  end
84
77
 
85
- # @param stack_prefix AWS tag: StackPrefix
86
- # @param author_aws_clients Array of AWS Clients and Resource connections:
87
- # - CloudWatchClient: AWS Cloudwatch Client.
88
- # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
89
- # - Ec2Resource: AWS EC2 Resource connection.
90
- # - ElbClient: AWS ElasticLoadBalancer Client.
91
78
  # @return new RubyAemAws::Component::Author instance
92
79
  def author
93
80
  RubyAemAws::Component::Author.new(@stack_prefix, @author_aws_clients)
94
81
  end
95
82
 
96
- # @param stack_prefix AWS tag: StackPrefix
97
- # @param chaos_monkey_aws_clients Array of AWS Clients and Resource connections:
98
- # - AutoScalingClient: AWS AutoScalingGroup Client.
99
- # - CloudWatchClient: AWS Cloudwatch Client.
100
- # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
101
- # - Ec2Resource: AWS EC2 Resource connection.
102
83
  # @return new RubyAemAws::Component::ChaosMonkey instance
103
84
  def chaos_monkey
104
85
  RubyAemAws::Component::ChaosMonkey.new(@stack_prefix, @aem_java_aws_clients)
105
86
  end
106
87
 
107
- # @param stack_prefix AWS tag: StackPrefix
108
- # @param orchestrator_aws_clients Array of AWS Clients and Resource connections:
109
- # - AutoScalingClient: AWS AutoScalingGroup Client.
110
- # - CloudWatchClient: AWS Cloudwatch Client.
111
- # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
112
- # - Ec2Resource: AWS EC2 Resource connection.
113
88
  # @return new RubyAemAws::Component::Orchestrator instance
114
89
  def orchestrator
115
90
  RubyAemAws::Component::Orchestrator.new(@stack_prefix, @aem_java_aws_clients)
116
91
  end
117
92
 
118
- # @param stack_prefix AWS tag: StackPrefix
119
- # @param publish_aws_clients Array of AWS Clients and Resource connections:
120
- # - AutoScalingClient: AWS AutoScalingGroup Client.
121
- # - CloudWatchClient: AWS Cloudwatch Client.
122
- # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
123
- # - Ec2Resource: AWS EC2 Resource connection.
124
93
  # @return new RubyAemAws::Component::Publish instance
125
94
  def publish
126
95
  RubyAemAws::Component::Publish.new(@stack_prefix, @publish_aws_clients)
127
96
  end
128
97
 
129
- # @param stack_prefix AWS tag: StackPrefix
130
- # @param dispatcher_aws_clients Array of AWS Clients and Resource connections:
131
- # - AutoScalingClient: AWS AutoScalingGroup Client.
132
- # - CloudWatchClient: AWS Cloudwatch Client.
133
- # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
134
- # - Ec2Resource: AWS EC2 Resource connection.
135
- # - ElbClient: AWS ElasticLoadBalancer Client.
136
98
  # @return new RubyAemAws::Component::PublishDispatcher instance
137
99
  def publish_dispatcher
138
100
  RubyAemAws::Component::PublishDispatcher.new(@stack_prefix, @dispatcher_aws_clients)
@@ -29,7 +29,6 @@ module RubyAemAws
29
29
  include SNSTopic
30
30
  include S3Access
31
31
 
32
- # @param dynamodb_client AWS DynamoDB client connection
33
32
  # @param params Array of AWS Clients and Resource connections:
34
33
  # - CloudWatchClient: AWS Cloudwatch Client.
35
34
  # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
@@ -42,7 +42,7 @@ module RubyAemAws
42
42
  end
43
43
 
44
44
  class Constants
45
- REGION_DEFAULT = 'ap-southeast-2'.freeze
45
+ REGION_DEFAULT = ENV['AWS_DEFAULT_REGION'] || ENV['aws_default_region'] || ENV['AWS_REGION'] || ENV['aws_region'] || 'ap-southeast-2'.freeze
46
46
  ACCESS_KEY_ID = ENV['AWS_ACCESS_KEY_ID'] || ENV['aws_access_key_id']
47
47
  SECRET_ACCESS_KEY = ENV['AWS_SECRET_ACCESS_KEY'] || ENV['aws_scret_access_key']
48
48
  PROFILE = ENV['AWS_PROFILE']
@@ -43,13 +43,6 @@ module RubyAemAws
43
43
 
44
44
  # Raise this when a component unexpectedly has more than one instance.
45
45
  class ExpectedSingleInstanceError < StandardError
46
- # def initialize(count, descriptor)
47
- # message << 'Expected exactly one instance'
48
- # message << " but got #{count}" unless count.nil?
49
- # message << "for (#{descriptor.stack_prefix}, #{descriptor.ec2.component}, #{descriptor.ec2.name})" unless descriptor.nil?
50
- # super(message)
51
- # end
52
-
53
46
  def initialize(msg = 'Expected exactly one instance')
54
47
  super
55
48
  end
@@ -170,7 +170,7 @@ module RubyAemAws
170
170
  return true unless response.events.empty?
171
171
  end
172
172
 
173
- # @param loggroup Cloudwatch loggroup name
173
+ # @param loggroup_name Cloudwatch loggroup name
174
174
  # @return True if Cloudwatch loggroup exists
175
175
  def loggroup?(loggroup_name)
176
176
  namespace = 'AWS/Logs'
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.0
4
+ version: 1.5.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: 2019-08-14 00:00:00.000000000 Z
11
+ date: 2020-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk