Unable to use a locally defined ~/.aws/credentials profile if it specifies a source_profile in v3 SDK #2087
Closed
3 tasks done
Labels
guidance
General information and guidance, answers to FAQs, or recommended best practices/resources.
needs-triage
This issue or PR still needs to be triaged.
Confirm by changing [ ] to [x] below to ensure that it's a bug:
Describe the bug
When attempting to use a profile defined in ~/.aws/credentials that refers to a role_arn and another source_profile, v3 of the SDK fails to assume the role where-as v2 of the SDK successfully assumes the role.
roleAssumer is missing from the STS client options and therefore the assume role never happens and a failure is returned.
This seems counter to:
https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_credential_provider_node.html
Is the issue in the browser/Node.js?
Node.js
If on Node.js, are you running this on AWS Lambda?
Running on laptop/MacOS
Details of the browser/Node.js version
v14.9.0
SDK version number
aws-sdk@2.746.0
@aws-sdk/client-sts@3.6.1
To Reproduce (observed behavior)
~/.aws/credentials:
Check that the profiles work using was-cli:
Test node script to check sts:GetCallerIdentity using the v2 and v3 SDK:
Running test $AWS_PROFILE=mycreds (profile contains keys only)
Running test with $AWS_PROFILE=adminrole (profile has role_arn and source_profile)
Expected behavior
The credential provider should be able to assume the profile role_arn using the credentials in the source_profile since role assumer is defined as optional, the default should achieve this?
Additional context
The outcome is the same regardless of $AWS_SDK_LOAD_CONFIG being defined
Excluding v2 of the SDK from the test does not affect the v3 outcome
The text was updated successfully, but these errors were encountered: