in lib/fluent/plugin/out_kinesis.rb [156:205]
def load_client
user_agent_suffix = "#{USER_AGENT_NAME}/#{FluentPluginKinesis::VERSION}"
options = {
user_agent_suffix: user_agent_suffix
}
if @region
options[:region] = @region
end
if @aws_key_id && @aws_sec_key
options.update(
access_key_id: @aws_key_id,
secret_access_key: @aws_sec_key,
)
elsif @profile
credentials_opts = {:profile_name => @profile}
credentials_opts[:path] = @credentials_path if @credentials_path
credentials = Aws::SharedCredentials.new(credentials_opts)
options[:credentials] = credentials
elsif @role_arn
credentials = Aws::AssumeRoleCredentials.new(
client: Aws::STS::Client.new(options),
role_arn: @role_arn,
role_session_name: "aws-fluent-plugin-kinesis",
external_id: @external_id,
duration_seconds: 60 * 60
)
options[:credentials] = credentials
end
if @debug
options.update(
logger: Logger.new(log.out),
log_level: :debug
)
end
if @http_proxy
options[:http_proxy] = @http_proxy
end
@client = Aws::Kinesis::Client.new(options)
end