ruby_aem_aws 2.3.1 → 2.4.1

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: 95cd5259db49091f98e9697a3af15805c17e41a2
4
- data.tar.gz: d4900116bedbdd096c20d3a7f2bacaaa35a9d31c
3
+ metadata.gz: 127f5b90f64b8f1bd149bb34c3b1a6bfaf2d3348
4
+ data.tar.gz: 412586db736b7bcb7fc4737cae3f18a392ef22aa
5
5
  SHA512:
6
- metadata.gz: 9c2e3351dceefc15ff96a2b3d5e8b9caa4629ac771e2d381e63d6ca27cff1ebd59f0d8c9331eed4388711af205e83a38bdb7a8069e8f2e44fe60e1cc3fe8ffd6
7
- data.tar.gz: 8600e31f276230b59f5f5edb9614909b15d7d54444bddb77486515c802d13db688cf2010860486b0650001de0ff04beaeb771c8b26f3021a8a0bfb0010215275
6
+ metadata.gz: 3ad3b0e2d3d321f59d614a4a4bdb4522db74c73568da452a67ffd61deb93f67eedde53c4019630159ad1330a2e0c017e77e8a77b912ce1d4a9c53bd6a5668140
7
+ data.tar.gz: 024e9c16f7e8cbd5e9d2a63382b8ce6f9041372949d03e51583547fcc901af1356a7eefb4559821c1f53011ebb5bdca4eaa617a91c1e2d95a5090665a443d271
data/conf/gem.yaml CHANGED
@@ -1 +1 @@
1
- version: 2.3.1
1
+ version: 2.4.1
@@ -18,6 +18,8 @@ require_relative '../component/chaos_monkey'
18
18
  require_relative '../component/orchestrator'
19
19
  require_relative '../component/publish_dispatcher'
20
20
  require_relative '../component/publish'
21
+ require_relative '../component/preview_publish_dispatcher'
22
+ require_relative '../component/preview_publish'
21
23
  require_relative '../mixins/metric_verifier'
22
24
 
23
25
  module RubyAemAws
@@ -96,9 +98,19 @@ module RubyAemAws
96
98
  RubyAemAws::Component::Publish.new(@stack_prefix, @publish_aws_clients)
97
99
  end
98
100
 
101
+ # @return new RubyAemAws::Component::PreviewPublish instance
102
+ def preview_publish
103
+ RubyAemAws::Component::PreviewPublish.new(@stack_prefix, @publish_aws_clients)
104
+ end
105
+
99
106
  # @return new RubyAemAws::Component::PublishDispatcher instance
100
107
  def publish_dispatcher
101
108
  RubyAemAws::Component::PublishDispatcher.new(@stack_prefix, @dispatcher_aws_clients)
102
109
  end
110
+
111
+ # @return new RubyAemAws::Component::PreviewPublishDispatcher instance
112
+ def preview_publish_dispatcher
113
+ RubyAemAws::Component::PreviewPublishDispatcher.new(@stack_prefix, @dispatcher_aws_clients)
114
+ end
103
115
  end
104
116
  end
@@ -52,7 +52,8 @@ module RubyAemAws
52
52
  until curr_response.next_token.nil?
53
53
  next_token = { next_token: curr_response.next_token }
54
54
  filter.update(next_token)
55
- response = curr_response
55
+ # empty events should be ignored
56
+ response = curr_response unless curr_response.events.empty?
56
57
  curr_response = cloud_watch_log_client.filter_log_events(filter)
57
58
  end
58
59
 
@@ -0,0 +1,79 @@
1
+ # Copyright 2018-2021 Shine Solutions Group
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require_relative '../abstract/grouped_component'
16
+ require_relative '../abstract/snapshot'
17
+ require_relative '../constants'
18
+ require_relative '../mixins/healthy_resource_verifier'
19
+ require_relative '../mixins/metric_verifier'
20
+ require_relative '../mixins/snapshot_verifier'
21
+
22
+ module RubyAemAws
23
+ module Component
24
+ # Interface to the AWS instance running the Preview Publish component of a full-set AEM stack.
25
+ class PreviewPublish
26
+ attr_reader :descriptor, :ec2_resource, :cloud_watch_client, :asg_client, :cloud_watch_log_client
27
+
28
+ include AbstractGroupedComponent
29
+ include AbstractSnapshot
30
+ include HealthyResourceVerifier
31
+ include MetricVerifier
32
+ include SnapshotVerifier
33
+
34
+ EC2_COMPONENT = 'preview-publish'.freeze
35
+ EC2_NAME = 'AEM Preview Publish'.freeze
36
+
37
+ # @param stack_prefix AWS tag: StackPrefix
38
+ # @param params Array of AWS Clients and Resource connections:
39
+ # - AutoScalingClient: AWS AutoScalingGroup Client.
40
+ # - CloudWatchClient: AWS Cloudwatch Client.
41
+ # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
42
+ # - Ec2Resource: AWS EC2 Resource connection.
43
+ # @return new RubyAemAws::FullSet::PreviewPublish
44
+ def initialize(stack_prefix, params)
45
+ @descriptor = ComponentDescriptor.new(stack_prefix,
46
+ EC2Descriptor.new(EC2_COMPONENT, EC2_NAME))
47
+ @asg_client = params[:AutoScalingClient]
48
+ @cloud_watch_client = params[:CloudWatchClient]
49
+ @cloud_watch_log_client = params[:CloudWatchLogsClient]
50
+ @ec2_resource = params[:Ec2Resource]
51
+ end
52
+
53
+ def terminate_all_instances
54
+ get_all_instances.each do |i|
55
+ next if i.nil? || i.state.code != Constants::INSTANCE_STATE_CODE_RUNNING
56
+
57
+ i.terminate
58
+ i.wait_until_terminated
59
+ end
60
+ end
61
+
62
+ def terminate_random_instance
63
+ instance = get_random_instance
64
+ instance.terminate
65
+ instance.wait_until_terminated
66
+ end
67
+
68
+ def get_tags
69
+ tags = []
70
+ get_all_instances.each do |i|
71
+ next if i.nil? || i.state.code != Constants::INSTANCE_STATE_CODE_RUNNING
72
+
73
+ tags.push(i.tags)
74
+ end
75
+ tags
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,84 @@
1
+ # Copyright 2018-2021 Shine Solutions Group
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require_relative '../abstract/grouped_component'
16
+ require_relative '../abstract/snapshot'
17
+ require_relative '../constants'
18
+ require_relative '../mixins/healthy_resource_verifier'
19
+ require_relative '../mixins/metric_verifier'
20
+ require_relative '../mixins/snapshot_verifier'
21
+
22
+ module RubyAemAws
23
+ module Component
24
+ # Interface to the AWS instance running the Preview PublishDispatcher component of a full-set AEM stack.
25
+ class PreviewPublishDispatcher
26
+ attr_reader :descriptor, :ec2_resource, :asg_client, :elb_client, :cloud_watch_client, :cloud_watch_log_client
27
+
28
+ include AbstractGroupedComponent
29
+ include AbstractSnapshot
30
+ include HealthyResourceVerifier
31
+ include MetricVerifier
32
+ include SnapshotVerifier
33
+
34
+ EC2_COMPONENT = 'preview-publish-dispatcher'.freeze
35
+ EC2_NAME = 'AEM Preview Publish Dispatcher'.freeze
36
+ ELB_ID = 'PreviewPublishDispatcherLoadBalancer'.freeze
37
+ ELB_NAME = 'AEM Preview Publish Dispatcher Load Balancer'.freeze
38
+
39
+ # @param stack_prefix AWS tag: StackPrefix
40
+ # @param params Array of AWS Clients and Resource connections:
41
+ # - AutoScalingClient: AWS AutoScalingGroup Client.
42
+ # - CloudWatchClient: AWS Cloudwatch Client.
43
+ # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
44
+ # - Ec2Resource: AWS EC2 Resource connection.
45
+ # - ElbClient: AWS ElasticLoadBalancer v2 Client.
46
+ # @return new RubyAemAws::FullSet::PreviewPublishDispatcher
47
+ def initialize(stack_prefix, params)
48
+ @descriptor = ComponentDescriptor.new(stack_prefix,
49
+ EC2Descriptor.new(EC2_COMPONENT, EC2_NAME),
50
+ ELBDescriptor.new(ELB_ID, ELB_NAME))
51
+ @asg_client = params[:AutoScalingClient]
52
+ @cloud_watch_client = params[:CloudWatchClient]
53
+ @cloud_watch_log_client = params[:CloudWatchLogsClient]
54
+ @ec2_resource = params[:Ec2Resource]
55
+ @elb_client = params[:ElbClient]
56
+ end
57
+
58
+ def terminate_all_instances
59
+ get_all_instances.each do |i|
60
+ next if i.nil? || i.state.code != Constants::INSTANCE_STATE_CODE_RUNNING
61
+
62
+ i.terminate
63
+ i.wait_until_terminated
64
+ end
65
+ end
66
+
67
+ def terminate_random_instance
68
+ instance = get_random_instance
69
+ instance.terminate
70
+ instance.wait_until_terminated
71
+ end
72
+
73
+ def get_tags
74
+ tags = []
75
+ get_all_instances.each do |i|
76
+ next if i.nil? || i.state.code != Constants::INSTANCE_STATE_CODE_RUNNING
77
+
78
+ tags.push(i.tags)
79
+ end
80
+ tags
81
+ end
82
+ end
83
+ end
84
+ end
@@ -40,7 +40,7 @@ module RubyAemAws
40
40
  # - CloudWatchClient: AWS Cloudwatch Client.
41
41
  # - CloudWatchLogsClient: AWS Cloudwatch Logs Client.
42
42
  # - Ec2Resource: AWS EC2 Resource connection.
43
- # @return new RubyAemAws::FullSet::AuthorPrimary
43
+ # @return new RubyAemAws::FullSet::Publish
44
44
  def initialize(stack_prefix, params)
45
45
  @descriptor = ComponentDescriptor.new(stack_prefix,
46
46
  EC2Descriptor.new(EC2_COMPONENT, EC2_NAME))
@@ -28,7 +28,7 @@ module RubyAemAws
28
28
  end
29
29
 
30
30
  def describe_instance(instance)
31
- "#{instance.instance_id} (#{instance.state.name})"
31
+ "#{instance.instance_id} (#{instance.state.name} #{instance.state.code})"
32
32
  end
33
33
  end
34
34
  end
@@ -139,7 +139,6 @@ module RubyAemAws
139
139
  dimension_filter = dimensions_filter_for_cloudwatch_metric(dimension_values)
140
140
 
141
141
  response = get_metrics(namespace, metric_name, dimension_filter)
142
-
143
142
  return true unless response.metrics.empty?
144
143
  end
145
144
 
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: 2.3.1
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shine Solutions
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-12 00:00:00.000000000 Z
11
+ date: 2023-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-autoscaling
@@ -223,6 +223,8 @@ files:
223
223
  - lib/ruby_aem_aws/component/chaos_monkey.rb
224
224
  - lib/ruby_aem_aws/component/component_descriptor.rb
225
225
  - lib/ruby_aem_aws/component/orchestrator.rb
226
+ - lib/ruby_aem_aws/component/preview_publish.rb
227
+ - lib/ruby_aem_aws/component/preview_publish_dispatcher.rb
226
228
  - lib/ruby_aem_aws/component/publish.rb
227
229
  - lib/ruby_aem_aws/component/publish_dispatcher.rb
228
230
  - lib/ruby_aem_aws/component/stack_manager_resources.rb