aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

Configurable defaults for sso_start_url and sso_region in `aws configure sso`

Open benkehoe opened this issue 5 years ago • 5 comments

Currently, aws configure sso is able to scan over the config file and pick up existing values of sso_start_url and sso_region, but the default (hitting enter) sets it to none. This is almost never useful when setting up a profile for AWS SSO. I would like the ability to set a default value for this, perhaps through environment variables, so that when I'm configuring a profile for AWS SSO, and I'm using my most-used AWS SSO provider (and I imagine that most folks only have one anyway), I can just hit enter on those first two and get to the meat of the profile config, the account and role name.

benkehoe avatar May 13 '20 19:05 benkehoe

I created a small shell script to do this: https://gist.github.com/benkehoe/73534b3f59e7ea7de18a1d712173ce07

I still want it natively in the CLI ;-)

benkehoe avatar May 13 '20 21:05 benkehoe

Hi @benkehoe , thanks for the request, could you also make this as a PR ?

KaibaLopez avatar May 13 '20 21:05 KaibaLopez

I can try! From what I can tell, in awscli.customizations.sso I would need to add another parameter, something like default_value, to both PTKPrompt.get_valueand ConfigureSSOCommand._prompt_for, and then use those parameters in ConfigureSSOCommand._prompt_for_start_url and _prompt_for_sso_region. I note that there's actually a comment in the code, "TODO: figure out a way to get a list of reasonable client regions" so this isn't a new idea!

benkehoe avatar May 13 '20 22:05 benkehoe

There is still no way to set defaults when configuring aws sso to avoid prompting?

kapitanluffy avatar Feb 27 '25 07:02 kapitanluffy

There is still no way to set defaults when configuring aws sso to avoid prompting?

Seems so, it's kinda weird that we can't set this as an env variable. Would be nice to be able to configure new profiles (we create new accounts often) with organisation defaults.

Gibbo3771 avatar Nov 11 '25 14:11 Gibbo3771