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
40
41
42
43
44
45
46
|
# 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)
opts.merge!(self.aws_service_endpoint(@region))
else
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
if @use_aws_bundled_ca
aws_core_library = Gem.loaded_specs['aws-sdk-core']&.full_gem_path or fail("AWS Core library not available")
opts[:ssl_ca_bundle] = File.expand_path('ca-bundle.crt', aws_core_library).tap do |aws_core_ca_bundle|
fail("AWS Core CA bundle not found") unless File.exists?(aws_core_ca_bundle)
end
end
return opts
end
|