Coder Social home page Coder Social logo

Comments (6)

repeatedly avatar repeatedly commented on August 25, 2024

Hmm... could you send a PR?
I'm not sure where is the code did you edit.

from fluent-plugin-s3.

 avatar commented on August 25, 2024

Hi, for testing I added line 231 you see below. I hard-coded the value just for testing purposes. How do I send a PR?

227       when @assume_role_credentials
228         c = @assume_role_credentials
229         credentials_options[:role_arn] = c.role_arn
230         credentials_options[:role_session_name] = c.role_session_name
231         **credentials_options[:region] = 'us-east-1'**
232         credentials_options[:policy] = c.policy if c.policy
233         credentials_options[:duration_seconds] = c.duration_seconds if c.duration_seconds
234         credentials_options[:external_id] = c.external_id if c.external_id
235         options[:credentials] = Aws::AssumeRoleCredentials.new(credentials_options)

from fluent-plugin-s3.

 avatar commented on August 25, 2024

That was without the asterisks, sorry I was trying to make it bold. For clarity, the code is, with line 231 being the addition with a hard-coded value for testing/debugging.

227       when @assume_role_credentials
228         c = @assume_role_credentials
229         credentials_options[:role_arn] = c.role_arn
230         credentials_options[:role_session_name] = c.role_session_name
231         credentials_options[:region] = 'us-east-1'
232         credentials_options[:policy] = c.policy if c.policy
233         credentials_options[:duration_seconds] = c.duration_seconds if c.duration_seconds
234         credentials_options[:external_id] = c.external_id if c.external_id
235         options[:credentials] = Aws::AssumeRoleCredentials.new(credentials_options)

from fluent-plugin-s3.

repeatedly avatar repeatedly commented on August 25, 2024

We have s3_region parameter so you cau use it.
See this code >

options[:region] = @s3_region if @s3_region

from fluent-plugin-s3.

 avatar commented on August 25, 2024

So sorry, the code above obviously was wrong. So when I did set the env variable AWS_REGION='us-east-1' the problem goes away. I did have the s3_region setup in the config file, but looks like it totally ignored it when using assume role.

This crazy code change did indeed work when the environment variable was not setup.
options[:credentials] = Aws::AssumeRoleCredentials.new(client: Aws::STS::Client.new(region: 'us-east-1'), role_arn: c.role_arn, role_session_name: c.role_session_name)

Of course, would be better if the S3 plugin could use the s3_region parameter in assume role.

from fluent-plugin-s3.

okkez avatar okkez commented on August 25, 2024

Aws::AssumeRoleCredentials uses Aws::STS::Client without region by default.
We should set region to Aws::STS::Client.

See https://github.com/aws/aws-sdk-ruby/blob/master/aws-sdk-core/lib/aws-sdk-core/assume_role_credentials.rb#L39

from fluent-plugin-s3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.