fluent-plugin-cloudwatch-logs 0.14.0 → 0.14.3

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: ecdab23fc3b9c43ff71a49331694a6f9f88b0a7a27c70259b1a5b4c55894744d
4
- data.tar.gz: 4197f274338c7134601dccfbb3e56b8672923b602f59e8fccc2d3ed43c9e4c6b
3
+ metadata.gz: 235843b98cb5dd9dc3d827f118f0fac6a497b458506045e2058e3a3e0e616a03
4
+ data.tar.gz: 05a0bdca272a046f17196b086bc18fa4d2b80ab51acd0a541c6c1967d28d24a4
5
5
  SHA512:
6
- metadata.gz: 228c5d942bba9b410f926136c59a5ad65482580d67076f8703e5dbf7b1cd778beb447b2c175d07c20d20616a2dad8d74607db2665393387edda0e534a7da8362
7
- data.tar.gz: 6e3cd9935e8c64b390877240a18175d8b1dd0ea3df34300658ebe66df22d728e0a45beba10ac8cbc63f9159d5a725abedcd4f62cdd7b244bd5c25e17a812153a
6
+ metadata.gz: 6de86a474fcb6ba9d00a7d31ee2fdce32ac1b2b850d17db65443d40a6156c2ae683655fc8cf40fd80fcab28bc5efdd18c3237d9fe0945cb3395a68b92a102391
7
+ data.tar.gz: e5f58962889f125942abb1262e1ccf7a264e0f86bd196dd5959e98f10a970f58a65785ac5f9e743001adc2740d42892e7fd729b2b90dfb63eb07224debe4f55c
data/README.md CHANGED
@@ -106,7 +106,7 @@ export AWS_ACCESS_KEY_ID="YOUR_ACCESS_KEY"
106
106
  export AWS_SECRET_ACCESS_KEY="YOUR_SECRET_ACCESS_KEY"
107
107
  ```
108
108
 
109
- Note: For this to work persistently the enviornment will need to be set in the startup scripts or docker variables.
109
+ Note: For this to work persistently the environment will need to be set in the startup scripts or docker variables.
110
110
 
111
111
  ### AWS Configuration
112
112
 
@@ -184,6 +184,7 @@ Fetch sample log from CloudWatch Logs:
184
184
  * `aws_sec_key`: AWS Secret Access Key. See [Authentication](#authentication) for more information.
185
185
  * `concurrency`: use to set the number of threads pushing data to CloudWatch. (default: 1)
186
186
  * `endpoint`: use this parameter to connect to the local API endpoint (for testing)
187
+ * `ssl_verify_peer`: when `true` (default), SSL peer certificates are verified when establishing a connection. Setting to `false` can be useful for testing.
187
188
  * `http_proxy`: use to set an optional HTTP proxy
188
189
  * `include_time_key`: include time key as part of the log entry (defaults to UTC)
189
190
  * `json_handler`: name of the library to be used to handle JSON data. For now, supported libraries are `json` (default) and `yajl`.
@@ -263,6 +264,7 @@ Please refer to [the PutRetentionPolicy column in documentation](https://docs.aw
263
264
  * `aws_sts_session_name`: the session name to use with sts authentication (default: `fluentd`)
264
265
  * `aws_use_sts`: use [AssumeRoleCredentials](http://docs.aws.amazon.com/sdkforruby/api/Aws/AssumeRoleCredentials.html) to authenticate, rather than the [default credential hierarchy](http://docs.aws.amazon.com/sdkforruby/api/Aws/CloudWatchLogs/Client.html#initialize-instance_method). See 'Cross-Account Operation' below for more detail.
265
266
  * `endpoint`: use this parameter to connect to the local API endpoint (for testing)
267
+ * `ssl_verify_peer`: when `true` (default), SSL peer certificates are verified when establishing a connection. Setting to `false` can be useful for testing.
266
268
  * `fetch_interval`: time period in seconds between checking CloudWatch for new logs. (default: 60)
267
269
  * `http_proxy`: use to set an optional HTTP proxy
268
270
  * `json_handler`: name of the library to be used to handle JSON data. For now, supported libraries are `json` (default) and `yajl`.
@@ -2,7 +2,7 @@ module Fluent
2
2
  module Plugin
3
3
  module Cloudwatch
4
4
  module Logs
5
- VERSION = "0.14.0"
5
+ VERSION = "0.14.3"
6
6
  end
7
7
  end
8
8
  end
@@ -21,8 +21,10 @@ module Fluent::Plugin
21
21
  config_param :aws_sts_policy, :string, default: nil
22
22
  config_param :aws_sts_duration_seconds, :time, default: nil
23
23
  config_param :aws_sts_endpoint_url, :string, default: nil
24
+ config_param :aws_ecs_authentication, :bool, default: false
24
25
  config_param :region, :string, default: nil
25
26
  config_param :endpoint, :string, default: nil
27
+ config_param :ssl_verify_peer, :bool, :default => true
26
28
  config_param :tag, :string
27
29
  config_param :log_group_name, :string
28
30
  config_param :add_log_group_name, :bool, default: false
@@ -31,7 +33,7 @@ module Fluent::Plugin
31
33
  config_param :log_stream_name, :string, default: nil
32
34
  config_param :use_log_stream_name_prefix, :bool, default: false
33
35
  config_param :state_file, :string, default: nil,
34
- deprecated: "Use <stroage> instead."
36
+ deprecated: "Use <storage> instead."
35
37
  config_param :fetch_interval, :time, default: 60
36
38
  config_param :http_proxy, :string, default: nil
37
39
  config_param :json_handler, :enum, list: [:yajl, :json], default: :yajl
@@ -85,6 +87,7 @@ module Fluent::Plugin
85
87
  options = {}
86
88
  options[:region] = @region if @region
87
89
  options[:endpoint] = @endpoint if @endpoint
90
+ options[:ssl_verify_peer] = @ssl_verify_peer
88
91
  options[:http_proxy] = @http_proxy if @http_proxy
89
92
 
90
93
  if @aws_use_sts
@@ -115,6 +118,10 @@ module Fluent::Plugin
115
118
  credentials_options[:client] = Aws::STS::Client.new(:region => @region)
116
119
  end
117
120
  options[:credentials] = Aws::AssumeRoleWebIdentityCredentials.new(credentials_options)
121
+ elsif @aws_ecs_authentication
122
+ # collect AWS credential from ECS relative uri ENV variable
123
+ aws_container_credentials_relative_uri = ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"]
124
+ options[:credentials] = Aws::ECSCredentials.new({credential_path: aws_container_credentials_relative_uri}).credentials
118
125
  else
119
126
  options[:credentials] = Aws::Credentials.new(@aws_key_id, @aws_sec_key) if @aws_key_id && @aws_sec_key
120
127
  end
@@ -192,7 +199,7 @@ module Fluent::Plugin
192
199
  log_stream_name_prefix = @use_todays_log_stream ? get_todays_date : @log_stream_name
193
200
  begin
194
201
  log_streams = describe_log_streams(log_stream_name_prefix, nil, nil, log_group_name)
195
- log_streams.concat(describe_log_streams(get_yesterdays_date)) if @use_todays_log_stream
202
+ log_streams.concat(describe_log_streams(get_yesterdays_date, nil, nil, log_group_name)) if @use_todays_log_stream
196
203
  log_streams.each do |log_stream|
197
204
  log_stream_name = log_stream.log_stream_name
198
205
  events = get_events(log_group_name, log_stream_name)
@@ -23,8 +23,10 @@ module Fluent::Plugin
23
23
  config_param :aws_sts_policy, :string, default: nil
24
24
  config_param :aws_sts_duration_seconds, :time, default: nil
25
25
  config_param :aws_sts_endpoint_url, :string, default: nil
26
+ config_param :aws_ecs_authentication, :bool, default: false
26
27
  config_param :region, :string, :default => nil
27
28
  config_param :endpoint, :string, :default => nil
29
+ config_param :ssl_verify_peer, :bool, :default => true
28
30
  config_param :log_group_name, :string, :default => nil
29
31
  config_param :log_stream_name, :string, :default => nil
30
32
  config_param :auto_create_stream, :bool, default: false
@@ -120,6 +122,7 @@ module Fluent::Plugin
120
122
  options[:log_level] = :debug if log
121
123
  options[:region] = @region if @region
122
124
  options[:endpoint] = @endpoint if @endpoint
125
+ options[:ssl_verify_peer] = @ssl_verify_peer
123
126
  options[:instance_profile_credentials_retries] = @aws_instance_profile_credentials_retries if @aws_instance_profile_credentials_retries
124
127
 
125
128
  if @aws_use_sts
@@ -150,6 +153,10 @@ module Fluent::Plugin
150
153
  credentials_options[:client] = Aws::STS::Client.new(:region => @region)
151
154
  end
152
155
  options[:credentials] = Aws::AssumeRoleWebIdentityCredentials.new(credentials_options)
156
+ elsif @aws_ecs_authentication
157
+ # collect AWS credential from ECS relative uri ENV variable
158
+ aws_container_credentials_relative_uri = ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"]
159
+ options[:credentials] = Aws::ECSCredentials.new({credential_path: aws_container_credentials_relative_uri}).credentials
153
160
  else
154
161
  options[:credentials] = Aws::Credentials.new(@aws_key_id, @aws_sec_key) if @aws_key_id && @aws_sec_key
155
162
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-cloudwatch-logs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-10 00:00:00.000000000 Z
11
+ date: 2022-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  - !ruby/object:Gem::Version
167
167
  version: '0'
168
168
  requirements: []
169
- rubygems_version: 3.2.15
169
+ rubygems_version: 3.2.32
170
170
  signing_key:
171
171
  specification_version: 4
172
172
  summary: CloudWatch Logs Plugin for Fluentd