Open mengano-net opened 2 years ago
Probably reset
is what you're looking for:
> aws-adfs reset --help
Usage: aws-adfs reset [OPTIONS]
removes stored profile
Options:
--profile TEXT AWS cli profile that will be removed
--help Show this message and exit.
Thanks for your time and reply. Um … almost but not quite… let me explain:
Using aws-adfs reset
removes the aws cli profile entirely, deleting it from ~/.aws/config, also removing any custom entries I may have in that profile.
I would much rather have an aws adfs logout
that would remove the session tokens, leaving the rest of the profile in intact
Sorry this is so late.... I do this by declaring a unique profile name during the login command. to be specific, I'm using the "credential-process" method with --stdout set, so that when I do CLI commands i can set --profile DEV, then on the next command --profile QA, for example. when i added all my ~/.aws/credntial entries without their own --profile flags, I had the same behavior you describe. adding a --profile flaf for the login command (which I happen to set as the same value as the CLI profile name) got me exactly what I needed. from there, you can specify the profile you want, or do export AWS_PROFILE=profileName and it will remain set as long as you need.
@mattmauriello Thanks. Yup, that's what I did as well. I think however, for completeness sake, you should consider adding a --logout parameter, so that you can discard AWS CLI access tokens from a profile and session, instead of waiting until they expire.
I'm late on the argument but if you want to reset your adfs connection you just need to delete the directory ~/.aws/adfs_cookies_XXXXXXXXXXXXXXXX
.
I need to be able to switch connections between multiple AWS accounts/IAM roles. I would love to have an
aws-adfs logout
implementation, so that I can logout from one role, then again issueaws-adfs login
to select another account/role.but if I then try to login again, before the STS session timeout, I can't switch to another account/role, it only shows me details of the current session.
❯
❯ aws-adfs --version 1.24.5 ❯ ❯ sw_vers ProductName: macOS ProductVersion: 12.1 BuildVersion: 21C52 ❯