Module: LogStash::PluginMixins::AwsConfig::V2

Defined in:
lib/logstash/plugin_mixins/aws_config/v2.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
# File 'lib/logstash/plugin_mixins/aws_config/v2.rb', line 5

def self.included(base)
  base.extend(self)
  base.send(:include, LogStash::PluginMixins::AwsConfig::Generic)
end

Instance Method Details

#aws_options_hashObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/logstash/plugin_mixins/aws_config/v2.rb', line 11

def aws_options_hash
  opts = {}

  opts[:http_proxy] = @proxy_uri if @proxy_uri

  if @role_arn
    credentials = assume_role(opts.dup)
    opts[:credentials] = credentials
  else
    credentials = aws_credentials
    opts[:credentials] = credentials if credentials
  end

  if self.respond_to?(:aws_service_endpoint)
    # used by CloudWatch to basically do the same as bellow (returns { region: region })
    opts.merge!(self.aws_service_endpoint(@region))
  else
    # NOTE: setting :region works with the aws sdk (resolves correct endpoint)
    opts[:region] = @region
  end

  opts[:endpoint] = @endpoint unless @endpoint.nil?

  if respond_to?(:additional_settings)
    opts = symbolize_keys_and_cast_true_false(additional_settings).merge(opts)
  end

  return opts
end