Add flags to skip prompts for `aws configure sso`
- Dominant language
- Python
- Stars
- 17.3k
- Forks
- 4.6k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 13
Description
NOTE: I already have a PR for this (#6675), but the contrib guidelines suggest opening an issue for discussion, so I'm doing that.
**Is your feature request related to a problem? Please describe.**
As I said in my PR, apart from just personally finding the interactive prompt for `aws configure sso` kind of annoying, at my org we want to write some scripts for doing devops stuff, which would require that we have known, consistent profiles for the various accounts & permission levels the scripts would require. So we'd like to have another script which creates all of the profiles that these scripts would need in one go. Doing this with the interactive prompt isn't feasible, but doing something like
```
aws configure sso \
--profile faketestlulz \
--sso-start-url 'https://myorg.awsapps.com/start#/' \
--sso-region 'us-east-1' \
--sso-account-id '1234567890' \
--sso-role-name 'BuildArtifactsReadOnly' \
--default-region 'us-east-1' \
--default-output 'json'
```
many times in a script is totally reasonable.
The changes I've made in my PR would allow this (that snippet was copied from my quick-check script), but I'm a little leery about requiring everyone on the devops team to install this project from source, given how much trouble I had to get the source copy working & run the tests, so some solution which is actually incorporated into the release would be strongly preferable.
**Describe the solution you'd like**
I guess one of
a. Just accept & merge my PR
b. Implement parameter flags for these values yourselves & in your own way (as I said, it's been TODO since at least 2019-11-06).
c. Provide some other means to non-interactively create a list of profiles.
**Describe alternatives you've considered**
The alternative as far as we can tell is for everyone in the devops organization to be extremely consistent about following a standard naming convention for the profiles, and always making sure to create all the required profiles before running scripts. Not to put too fine a point on it, I hate this solution.
**Additional context**
One obvious deficiency with my PR is that I haven't added any tests. There are 2 issues with this:
d. I'm not totally sure what I would want to test other than "we prompt for a value iff it's not passed as a flag," and I don't currently understand enough about the args-handling of the project or the prompter to figure out how to test this.
e. The code isn't written in a very testable way (no judgment; I've written code I'm not proud of too), and I didn't want to completely rewrite the code without at least some idea of what the minimum requirements for acceptance were.
Feel free to offer guidance on these.
Contributor guide
Assessment
This issue has not been assessed yet.