Skip to content

Conversation

@ashovlin
Copy link
Member

Issue #, if available: #9869

Description of changes:

This adds a prompt to aws login to warn users when running it for a profile that already has a different style of credentials:

$ aws login

Warning: Profile 'default' is already configured with Access Key credentials. If you continue to log in, the CLI and other tools may continue to use the existing credentials instead.

You may run 'aws login --profile new-profile-name' to create a new profile, or else you may manually remove the existing credentials from 'default'.

Do you want to continue adding login credentials to 'default'? (y/n):

This should help avoid the confusing case where you run aws login but subsequent commands are still using different credentials.

I did not add support for clearing the other style of credentials yet. For access keys there wouldn't be an easy way to undo or retrieve them if we just delete them from the credentials file, so I'd want to be more careful here. If we get feedback, we could expand from y | n to y | n | clear in the future.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@hssyoo hssyoo self-requested a review December 17, 2025 18:54
Comment on lines +212 to +213
f'If you continue to log in, the CLI and other tools may '
f'continue to use the existing credentials instead.\n\n'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a weird experience and I feel like we should be gatekeeping here. Are there reasons we shouldn't just deny the login attempt here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants