Skip to content

Commit f439caa

Browse files
authored
Merge pull request #297 from atkinsj/in_s3_instanceprofile
Add support for ECSCredentials to in_s3
2 parents 1c9c7c8 + 139e1d0 commit f439caa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/fluent/plugin/in_s3.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,11 @@ def setup_credentials
209209
credentials_options[:port] = c.port if c.port
210210
credentials_options[:http_open_timeout] = c.http_open_timeout if c.http_open_timeout
211211
credentials_options[:http_read_timeout] = c.http_read_timeout if c.http_read_timeout
212-
options[:credentials] = Aws::InstanceProfileCredentials.new(credentials_options)
212+
if ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"]
213+
options[:credentials] = Aws::ECSCredentials.new(credentials_options)
214+
else
215+
options[:credentials] = Aws::InstanceProfileCredentials.new(credentials_options)
216+
end
213217
when @shared_credentials
214218
c = @shared_credentials
215219
credentials_options[:path] = c.path if c.path

0 commit comments

Comments
 (0)