-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update usage and README #10
base: master
Are you sure you want to change the base?
Conversation
shellcheck linting: - use `printf` instead of `echo` - use `$HOME` instead of `~` Use profile and `$HOME` in Usage output - ie if someone adds `--help` to the command line after specifying a `--profile xxx` already
- but not added to Usage or README Add unofficial strict mode shellcheck linting continued - quoting in `cfg_parser` - if cmd intead of `$?` checking
fe74a31
to
6312865
Compare
Support official AWSCLI environment variables AWS_DEFAULT_PROFILE and AWS_SHARED_CREDENTIALS_FILE. Use integers and arithmatic for show* variables. Add short options to README.md
Hi @virgilwashere thanks for the PR! I am happy with the make-over, though since so much code is touched it calls for some thorough testing. Have you be using and testing all the options? The The short options I could take or leave. I don't think we are so short on bytes that we need them as well as the (more legible) long options. But neither do that hurt if some people are fond of them. |
Hi @whereisaaron.
Yes, I'm actively using the script with this PR, and also the changes from my version branch incorporated. I've manually tested just about all of the changes... I'm even contemplating writing some Bats tests to submit to the repo too.
They are useful when interactively setting up my
This is how I'm using export AWS_DEFAULT_PROFILE='role-name@account-name'
print-aws-profile() {
[[ -z "$AWS_PROFILE" || -n "$1" ]] && AWS_PROFILE="${1:-$AWS_DEFAULT_PROFILE}"
AWS_REGION="${AWS_REGION:-$AWS_DEFAULT_REGION}"
get-aws-profile.sh --profile="$AWS_PROFILE"
printf 'export AWS_REGION=%s\n' "$AWS_REGION"
}
aws-profile() { eval $(print-aws-profile); }
aws_auth0_saml() {
[[ -v AWS_PROFILE ]] || AWS_PROFILE="${AWS_DEFAULT_PROFILE}"
printf 'Starting Auth0 SAML authentication for profile %s\n' "$AWS_PROFILE" >&2
saml-login -c "${AWS_PROFILE}" aws-assume-role "$@"
aws-profile
} Virgil |
Thanks @virgilwashere, well if you and @tomisaacson both use it and you're the ones contributing, let's add There are some other tools that use an env var of the same name, but they don't always use compatible time formats and don't store them in the the AWS credentials file. Does anything but auth0 do this? @tomisaacson which tools did you use it with? |
I'd say "that's what |
📝 Update usage and README
release
👍⚙️ Add unofficial strict mode
🚨 shellcheck linting:
printf
instead ofecho
$HOME
instead of~
for robustnesscfg_parser
$?
checking🚸 improve usage output
$HOME
in Usage output--help
to the command line after specifying a--profile xxx
already✨ Enable short options