Closed MrJoy closed 1 month ago
Same issue as in: https://github.com/aws/aws-sdk-ruby/issues/3110
In general, we recommend that you use supported credentials objects rather than the responses returned by client calls - in this case, you can use the AssumeRoleCredentials which will give you automatic refreshing of the credentials as well!
Service clients expect credentials to be provided as a Aws::CredentialProvider, eg: see the S3 Client#initialize docs.
@alextwoods Thank you for the guidance. I'll take a look into that.
You should just be able to do: credentials = Aws::AssumeRoleCredentials.new(role_arn: get_role(env), role_session_name: 's3_gc')
as a drop in replacement, then create your client with it.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Describe the bug
Starting with 1.164.x, I'm seeing an exception when trying to assume a role via STS. 1.163.x does not exhibit this behavior. Specifically, the S3 SDK is attempting to access an apparently non-existent
account_id
property onAws::STS::Types::Credentials
.Regression Issue
Expected Behavior
I expected the code that I wrote and have been successfully using untouched for months to continue working.
Specifically, I'm using
Aws::STS::Client
toassume_role
before performing S3 operations.Current Behavior
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version
aws-sdk-s3 1.164.x and 1.165.x.
Environment details (Version of Ruby, OS environment)
Ruby 3.3.1, macOS 14.6.1