ruby_aem_aws 2.0.0 → 2.2.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 +4 -4
- data/conf/gem.yaml +1 -1
- data/lib/ruby_aem_aws/abstract/cloudwatch.rb +1 -1
- data/lib/ruby_aem_aws/abstract/component.rb +1 -1
- data/lib/ruby_aem_aws/abstract/grouped_component.rb +1 -1
- data/lib/ruby_aem_aws/abstract/single_component.rb +1 -1
- data/lib/ruby_aem_aws/abstract/snapshot.rb +1 -1
- data/lib/ruby_aem_aws/abstract/stackmanager.rb +1 -1
- data/lib/ruby_aem_aws/architecture/consolidated_stack.rb +1 -1
- data/lib/ruby_aem_aws/architecture/full_set_stack.rb +1 -1
- data/lib/ruby_aem_aws/architecture/stack_manager.rb +1 -1
- data/lib/ruby_aem_aws/client/cloudwatch.rb +16 -5
- data/lib/ruby_aem_aws/client/dynamo_db.rb +1 -1
- data/lib/ruby_aem_aws/client/s3.rb +1 -1
- data/lib/ruby_aem_aws/client/sns_topic.rb +1 -1
- data/lib/ruby_aem_aws/component/author.rb +1 -1
- data/lib/ruby_aem_aws/component/author_dispatcher.rb +1 -1
- data/lib/ruby_aem_aws/component/author_primary.rb +1 -1
- data/lib/ruby_aem_aws/component/author_publish_dispatcher.rb +1 -1
- data/lib/ruby_aem_aws/component/author_standby.rb +1 -1
- data/lib/ruby_aem_aws/component/chaos_monkey.rb +1 -1
- data/lib/ruby_aem_aws/component/component_descriptor.rb +1 -1
- data/lib/ruby_aem_aws/component/orchestrator.rb +1 -1
- data/lib/ruby_aem_aws/component/publish.rb +1 -1
- data/lib/ruby_aem_aws/component/publish_dispatcher.rb +1 -1
- data/lib/ruby_aem_aws/component/stack_manager_resources.rb +1 -1
- data/lib/ruby_aem_aws/constants.rb +4 -3
- data/lib/ruby_aem_aws/error.rb +2 -2
- data/lib/ruby_aem_aws/mixins/healthy_count_verifier.rb +1 -1
- data/lib/ruby_aem_aws/mixins/healthy_resource_verifier.rb +1 -1
- data/lib/ruby_aem_aws/mixins/healthy_state_verifier.rb +1 -1
- data/lib/ruby_aem_aws/mixins/instance_describer.rb +1 -1
- data/lib/ruby_aem_aws/mixins/metric_verifier.rb +1 -1
- data/lib/ruby_aem_aws/mixins/snapshot_verifier.rb +1 -1
- data/lib/ruby_aem_aws.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 889a43cb7a66988ec2ff320e7d3aee6bf253543a
|
4
|
+
data.tar.gz: c07c8773e792398b5f83d5dd33fc9e8d777b2650
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02b9dc41c34f82148160b47d8b1c064d8a519c0d9aa5955006d620ac67b8b490fe29580efc8491a8d55da43f37d395439d07148aca83bc36d33a4628f8e1b399
|
7
|
+
data.tar.gz: fcccded1753d2f957c8605b2a5811f24bbce6187140607761022bc6fb69e035ae1ebd9a8678e1f57a583030ec266d7a0c194ba81a9bf817ed1929594ba0b5ab2
|
data/conf/gem.yaml
CHANGED
@@ -1 +1 @@
|
|
1
|
-
version: 2.
|
1
|
+
version: 2.2.1
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2018 Shine Solutions
|
1
|
+
# Copyright 2018-2021 Shine Solutions Group
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -36,13 +36,24 @@ module RubyAemAws
|
|
36
36
|
# @param log_message Log message to filter for
|
37
37
|
# @return Cloudwatch log client filter_log_events response
|
38
38
|
def get_log_event(loggroup_name, log_stream_name, log_message)
|
39
|
+
# Initialise response as an empty response having no events and no next token
|
40
|
+
# This is needed to handle the scenario when initial filter log events returns
|
41
|
+
# a response with nil next token, ensuring the clients of this method to
|
42
|
+
# be able to identify any empty response events.
|
43
|
+
response = { events: [], next_token: nil }
|
44
|
+
|
39
45
|
filter = filter_for_cloudwatch_log_event(loggroup_name, log_stream_name, log_message)
|
40
|
-
|
46
|
+
curr_response = cloud_watch_log_client.filter_log_events(filter)
|
41
47
|
|
42
|
-
|
43
|
-
|
48
|
+
# Since late 2021 (circa aws-sdk-cloudwatchlog 1.45.0), the last response
|
49
|
+
# is always empty (empty response events and nil next token).
|
50
|
+
# Previous to late 2021, the last response used to contain the filtered events
|
51
|
+
# with nil next token.
|
52
|
+
until curr_response.next_token.nil?
|
53
|
+
next_token = { next_token: curr_response.next_token }
|
44
54
|
filter.update(next_token)
|
45
|
-
response =
|
55
|
+
response = curr_response
|
56
|
+
curr_response = cloud_watch_log_client.filter_log_events(filter)
|
46
57
|
end
|
47
58
|
|
48
59
|
response
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2018 Shine Solutions
|
1
|
+
# Copyright 2018-2021 Shine Solutions Group
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -48,8 +48,9 @@ module RubyAemAws
|
|
48
48
|
class Constants
|
49
49
|
REGION_DEFAULT = ENV['AWS_DEFAULT_REGION'] || ENV['aws_default_region'] || ENV['AWS_REGION'] || ENV['aws_region'] || 'ap-southeast-2'.freeze
|
50
50
|
ACCESS_KEY_ID = ENV['AWS_ACCESS_KEY_ID'] || ENV['aws_access_key_id']
|
51
|
-
SECRET_ACCESS_KEY = ENV['AWS_SECRET_ACCESS_KEY'] || ENV['
|
52
|
-
|
51
|
+
SECRET_ACCESS_KEY = ENV['AWS_SECRET_ACCESS_KEY'] || ENV['aws_secret_access_key']
|
52
|
+
SESSION_TOKEN = ENV['AWS_SESSION_TOKEN'] || ENV['aws_session_token']
|
53
|
+
PROFILE = ENV['AWS_PROFILE'] || ENV['aws_profile']
|
53
54
|
INSTANCE_STATE_HEALTHY = RubyAemAws::InstanceState::RUNNING.freeze
|
54
55
|
INSTANCE_STATE_CODE_RUNNING = RubyAemAws::InstanceStateCode::RUNNING
|
55
56
|
ELB_INSTANCE_INSERVICE = RubyAemAws::ELBInstanceState::HEALTHY.freeze
|
data/lib/ruby_aem_aws/error.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2018 Shine Solutions
|
1
|
+
# Copyright 2018-2021 Shine Solutions Group
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -53,7 +53,7 @@ module RubyAemAws
|
|
53
53
|
def initialize(msg = "No credentials found!
|
54
54
|
Set environment variable AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY or AWS_PROFILE.
|
55
55
|
Alternative use following syntax:
|
56
|
-
RubyAemAws::AemAws.new(aws_access_key_id,
|
56
|
+
RubyAemAws::AemAws.new(aws_access_key_id, aws_secret_access_key) or
|
57
57
|
RubyAemAws::AemAws.new(credentials_profile_name)")
|
58
58
|
super
|
59
59
|
end
|
data/lib/ruby_aem_aws.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2018 Shine Solutions
|
1
|
+
# Copyright 2018-2021 Shine Solutions Group
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -23,17 +23,19 @@ module RubyAemAws
|
|
23
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
|
+
# - aws_session_token: session token from STS
|
26
27
|
# - aws_profile: AWS profile name
|
27
28
|
# @return new RubyAemAws::AemAws instance
|
28
29
|
def initialize(conf = {})
|
29
30
|
conf[:aws_region] ||= Constants::REGION_DEFAULT
|
30
31
|
conf[:aws_access_key_id] ||= Constants::ACCESS_KEY_ID
|
31
32
|
conf[:aws_secret_access_key] ||= Constants::SECRET_ACCESS_KEY
|
33
|
+
conf[:aws_session_token] ||= Constants::SESSION_TOKEN
|
32
34
|
conf[:aws_profile] ||= Constants::PROFILE
|
33
35
|
|
34
36
|
Aws.config.update(region: conf[:aws_region])
|
35
37
|
|
36
|
-
credentials = Aws::Credentials.new(conf[:aws_access_key_id], conf[:aws_secret_access_key]) unless conf[:aws_access_key_id].nil?
|
38
|
+
credentials = Aws::Credentials.new(conf[:aws_access_key_id], conf[:aws_secret_access_key], conf[:aws_session_token]) unless conf[:aws_access_key_id].nil?
|
37
39
|
credentials = Aws::SharedCredentials.new(profile_name: conf[:aws_profile]) unless conf[:aws_profile].nil?
|
38
40
|
credentials = Aws::InstanceProfileCredentials.new if conf[:aws_profile].nil? && conf[:aws_access_key_id].nil?
|
39
41
|
raise RubyAemAws::ArgumentError unless defined? credentials
|
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.
|
4
|
+
version: 2.2.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:
|
11
|
+
date: 2021-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|