You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified all of my SDK modules are up-to-date (you can perform a bulk update with go get -u github.com/aws/aws-sdk-go-v2/...)
Describe the bug
aws-sdk-go-v2/config added aws login (login session) credential support in v1.32.0. It works when a profile uses login_session directly. But when a profile that uses login_session is referenced as the source_profile of an assume-role profile, LoadDefaultConfig fails with "failed to load assume role , of profile , ". The AWS CLI and boto3 resolve the identical configuration successfully.
Regression Issue
Select this option if this issue appears to be a regression.
Expected Behavior
A profile using login_session should be a valid credential source for an assume-role chain via source_profile, consistent with the AWS CLI/boto3 and with how SSO, credential_process, and web_identity_token_file are already accepted.
Current Behavior
Loading config via config.LoadDefaultConfig(ctx) returns an error:
failed to load assume role arn:aws:iam::111111111111:role/MyRole, of profile users, <nil>
After completing aws login --profile users, the AWS cli works - aws sts get-caller-identity returns session details, however running the collowing code errors as above
In config/shared_config.go, setFromIniSections validates the linked source profile and returns SharedConfigAssumeRoleError (with a nil wrapped Err, hence the <nil>) when hasCredentials() is false:
Acknowledgements
go get -u github.com/aws/aws-sdk-go-v2/...)Describe the bug
aws-sdk-go-v2/config added, ". The AWS CLI and boto3 resolve the identical configuration successfully.
aws login(login session) credential support in v1.32.0. It works when a profile uses login_session directly. But when a profile that uses login_session is referenced as the source_profile of an assume-role profile, LoadDefaultConfig fails with "failed to load assume role , of profileRegression Issue
Expected Behavior
A profile using login_session should be a valid credential source for an assume-role chain via source_profile, consistent with the AWS CLI/boto3 and with how SSO, credential_process, and web_identity_token_file are already accepted.
Current Behavior
Loading config via
config.LoadDefaultConfig(ctx)returns an error:Reproduction Steps
Given the following in
~/.aws/config:After completing
aws login --profile users, the AWS cli works -aws sts get-caller-identityreturns session details, however running the collowing code errors as abovePossible root cause
In
config/shared_config.go,setFromIniSectionsvalidates the linked source profile and returnsSharedConfigAssumeRoleError(with a nil wrapped Err, hence the <nil>) whenhasCredentials()is false:hasCredentials()never considersLoginSession:resolveCredsFromProfilehas support forLoginSessionbeing populated onSharedConfigthough, so it looks like it would work if it got that far.Possible Solution
Add a login-session case to
hasCredentials():Also consider giving the
!srcCfg.hasCredentials()branch a descriptive Err rather than emitting <nil>.Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
github.com/aws/aws-sdk-go-v2 v1.42.0
github.com/aws/aws-sdk-go-v2/config v1.32.25
github.com/aws/aws-sdk-go-v2/service/sts v1.43.3
Compiler and Version used
go version go1.26.1 linux/amd64
Operating System and version
Debian 13 - Linux 6.12.86+deb13-amd64