-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move CloudWatch to v2 of AWS SDK #32
Conversation
Use v2 of CloudWatch API - enables use of more standard options from the AWS mixin fixes logstash-plugins#30 (includes rudimentary IT to test correct behavior with password types)
Also fixes license identifier in gemspec to be valid SPDX identifier
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Got 2 optional suggestions.
Thread.abort_on_exception = true | ||
end | ||
|
||
describe '#register' do | ||
let(:config) { | ||
{ | ||
'access_key_id' => '1234', | ||
'secret_access_key' => 'secret', | ||
'secret_access_key' => LogStash::Util::Password.new('secret'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
cls = AWS.const_get(namespace) | ||
client_hash[namespace] = cls::Client.new(aws_options_hash) | ||
cls = Aws.const_get(namespace) | ||
# TODO: Move logger configuration into mixin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgotten TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a reminder for later - I'm planning on moving the logger config to the mixin (ideally in the integration plugin), so it will be the same across all AWS plugins
|
||
let(:settings) { { "access_key_id" => ENV['AWS_ACCESS_KEY_ID'], | ||
"secret_access_key" => LogStash::Util::Password.new(ENV['AWS_SECRET_ACCESS_KEY']), | ||
"region" => ENV["AWS_REGION"] || "us-east-1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps raise an explicit exception with specific instructions to set AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
if they're nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is actually valid for these values to be nil - there are a bunch of different ways that access_keys and secret_access_keys can be set in the AWS plugins. The underlying library will raise an error if none of those methods have been set.
This test is for the specific failure when the secret_access_key was set using in the configuration, which prior to this commit would cause the plugin not to work correctly.
s.version = '2.1.1' | ||
s.licenses = ['Apache License (2.0)'] | ||
s.version = '2.2.0' | ||
s.licenses = ['Apache-2.0'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm trying to fix these whenever I encounter them
Use v2 of CloudWatch API -
enables use of more standard options from the AWS mixin
fixes #30 (includes rudimentary IT to test correct behavior with
password types)
Thanks for contributing to Logstash! If you haven't already signed our CLA, here's a handy link: https://www.elastic.co/contributor-agreement/