aws-sdk-go icon indicating copy to clipboard operation
aws-sdk-go copied to clipboard

sso-session config file section doen't work.

Open steffakasid opened this issue 1 year ago • 5 comments

Describe the bug

I want to use the following config but it doesn't work with aws-sdk-go (even when it works fine with aws cli).

[default]
cli_pager=
output = json
region = eu-central-1
sso_session = mysession
sso_account_id = 12345

[profile iat]
cli_pager=
retry_mode = adaptive
max_attempts = 20
output = json
region = eu-central-1
sso_session = mysession
sso_account_id = 12345

[profile prod]
cli_pager=
retry_mode = adaptive
max_attempts = 20
output = jsonac
region = eu-central-1
sso_session = mysession
sso_account_id = 12345

# not used by gomplate, thefore we can't use it
[sso-session mysession]
sso_region = eu-central-1
sso_start_url = https://d-99671a01cd.awsapps.com/start
sso_role_name = ServiceTeamAdmin

I receive the following error: code: InvalidRequestException, message: RoleName must be supplied in the queryString params, fault: client

Tested with:

  • eksctl (0.167.0-dev+4280da7cd.2023-12-22T09:42:18Z)
  • gomplate (4.0.0-pre-2)
  • awsclean (0.16)

Expected Behavior

aws-sdk-go should work with sso-session.

Current Behavior

I receive the following error: code: InvalidRequestException, message: RoleName must be supplied in the queryString params, fault: client

Reproduction Steps

  • create a ~/.aws/config like described
  • do aws sso login
  • use aws-sdk-go to do aws stuff e.g. awsclean ami --dry-run --older-then 1d

Possible Solution

No response

Additional Information/Context

No response

SDK version used

v1.21.1

Environment details (Version of Go (go version)? OS name and version, etc.)

go version 1.19, uname -r 5.15.145-95.156.amzn2.x86_64

steffakasid avatar Jan 26 '24 09:01 steffakasid

Hi @steffakasid ,

I know we did some work regarding sso session in #4917 #4885 #4875 I also see that you are using SDK version v1.21.1 that was released 5 years ago. Can you please update your SDK version and try again?

Thanks, Ran~

RanVaknin avatar Mar 08 '24 21:03 RanVaknin

This issue has not received a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.

github-actions[bot] avatar Mar 19 '24 00:03 github-actions[bot]

I'll try to take a look today.

Regards Steffeen

steffakasid avatar Mar 19 '24 06:03 steffakasid

HI,

I just had a look with github.com/aws/aws-sdk-go-v2 v1.25.2. It somehow seems to work but I get the following error: " message: RoleName must be supplied in the queryString params" is this an issue from my ~/.aws/config or from my code?

Regards Steff

steffakasid avatar Mar 21 '24 13:03 steffakasid

Tiwat2540k avatar Mar 21 '24 15:03 Tiwat2540k

Hi @steffakasid ,

Sounds like it was working with v2 but you ran into an issue there? If you are still having trouble using this in our v2 SDK, please open a separate issue on the v2 repository.

Thanks, Ran~

RanVaknin avatar May 23 '24 21:05 RanVaknin

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar May 23 '24 21:05 github-actions[bot]