Open simonweil opened 2 years ago
Hello @simonweil,
Thanks for writing! I can confirm the bug you're experiencing, but I do not know the underlying cause from the change to prompt-toolkit
. I can say that the use case here is understandable, the solution is a bit fragile. You could determine the profile name ahead of time, and specify it when configuring SSO, like such?
aws configure sso --profile my_profile_name
Then you don't need to determine it after the fact, and can use that name with any of the profile configuration options the AWS CLI provides.
You can even set it first and then configure it:
export AWS_PROFILE=my_profile_name
aws configure sso
Hi @kdaily, Thank you for the response and acknowledgment.
The short answer is that no, this workaround would not work for me.
The long answer. I manage tens of AWS accounts and growing, each account has several roles with a naming convention that contains the account name and role type (admin, developer, devops, readonly, etc). Each account operates usually on a single region.
When choosing the account, role and region from the aws command, the aws/config file gets populated, meaning the next time I access that account and role I have less to setup (the region) and, more importantly, the aws
command sets up the correct profile name giving me the full context in which I'm operating. There is no place for human error in having the context in front of my eyes.
This context is used as policy to populate the title of the terminal tab and on the prompt to minimize the possibility of confusion related to the context in which we operate.
Defining the role myself in advance may cause the situation that the profile name and the context (account & role) differ due to human error and there is no unity within the team, meaning again harder context when working together.
Now, if I'd be working alone the issue wouldn't be as bad as I can make my own conventions but there is an entire team that work together and rely on this feature and function I shared in the original description.
We take many precautions to minimize the human mistake risk and having a context visible, clear and trustworthy is super important.
It's bad enough the accounts and roles appear in random order (#6108) , but now choosing the right account is like rolling a dice and that is very frustrating 😞
Confirm by changing [ ] to [x] below to ensure that it's a bug:
Describe the bug
When piping the
aws configure sso
command withtee
the output is broken, this happens since version2.4.19
when theprompt-toolkit
was upgraded.SDK version number
Platform/OS/Hardware/Device
To Reproduce (observed behavior)
Expected behavior
Logs/output
Additional context
I use this method in order to catch the profile name generated so I can automatically assign it to AWS_PROFILE env var and all AWS commands will now just work with the role, account and region I just connected to.
This is my nice function for it: