-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SharedCredentials not loading credentials if profile is a role #910
Comments
Looking at the code here:
It is clear that this isn't supported as this is just looking for those specific keys. Will need to also handle role_arn and source_profile. |
We do not currently support loading assume role credentials from the shared credentials file. You can use role_credentials = Aws::AssumeRoleCredentials.new(
role_arn: "linked::account::arn",
role_session_name: "session-name"
)
ec2 = Aws::EC2::Client.new(credentials: role_credentials) Does this help? |
I'm going to close this and add supporting assume role credentials from |
We use |
I just had this problem and got around it by instantiating an STS client and then getting the credentials: shared_creds = Aws::SharedCredentials.new(profile_name: 'default')
sts = Aws::STS::Client.new(credentials: shared_creds)
sts.config.credentials.credentials
# => #<Aws::Credentials access_key_id="ASIABLAHBLAH"> |
@amancevice running into the same issue:
Do you have any idea by any chance? |
The
|
When trying to use Aws::SharedCredentials, I am finding that if the profile is assuming a role, that the access keys are being set to nil.
The file ~/.aws/credentials.
Working:
Failing:
When I try to use the credentials I get the following error:
Is this the correct way to assume a role that is an existing profile? Otherwise, what is the best way to deal with this?
The text was updated successfully, but these errors were encountered: